Created
August 28, 2017 16:31
-
-
Save debugthings/a5ec37de944794288286ad2d0ec2de5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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