Created
May 31, 2020 18:18
-
-
Save jiimaho/ce4e97fd72070c85989cc0ea5e45eb9a 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
public class IgnoreRequestPathsTelemetryProcessor : ITelemetryProcessor | |
{ | |
private readonly ITelemetryProcessor _next; | |
public IgnoreRequestPathsTelemetryProcessor(ITelemetryProcessor next) | |
{ | |
_next = next; | |
} | |
public void Process(ITelemetry item) | |
{ | |
if (item is RequestTelemetry request && | |
(request.Url.AbsolutePath.StartsWith("/static/") || | |
request.Url.AbsolutePath.StartsWith("/img/") || | |
request.Url.AbsolutePath.StartsWith("/hc") || | |
request.Url.AbsolutePath.StartsWith("/login/img/") || | |
request.Url.AbsolutePath.StartsWith("/swagger/"))) | |
{ | |
return; | |
} | |
_next.Process(item); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment