Skip to content

Instantly share code, notes, and snippets.

@debugthings
Created August 28, 2017 16:31
Show Gist options
  • Select an option

  • Save debugthings/a5ec37de944794288286ad2d0ec2de5b to your computer and use it in GitHub Desktop.

Select an option

Save debugthings/a5ec37de944794288286ad2d0ec2de5b to your computer and use it in GitHub Desktop.
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
using System;
public class NoAzureBlobLoggingCalls : Microsoft.ApplicationInsights.Extensibility.ITelemetryProcessor
{
private ITelemetryProcessor Next { get; set; }
private bool parsed = false;
public const string AzureBlob = "Azure blob";
public const string AccountName = "kmshdprodlogs";
public NoAzureBlobLoggingCalls(ITelemetryProcessor next)
{
this.Next = next;
}
public void Process(ITelemetry item)
{
// Proc1 -> Proc2 ... -> TransmissionProc()
if (item is Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry)
{
var dependency = item as Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry;
if (dependency.Type == AzureBlob && dependency.Name.Contains(AccountName))
{
// Checks to see if this is an Azure blob type that matches the AccountName
return;
}
}
this.Next.Process(item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment