Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 10e0459

Browse files
pauljwilRassK
andauthored
Update gdi/get-data-in/serverless/azure/instrument-azure-functions-dotnet.rst
Co-authored-by: Rasmus Kuusmann <[email protected]>
1 parent aa567cd commit 10e0459

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

gdi/get-data-in/serverless/azure/instrument-azure-functions-dotnet.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,12 @@ After adding the dependencies, initialize OpenTelemetry in your function.
260260
var tp = Sdk.CreateTracerProviderBuilder()
261261
// Use Add[instrumentation-name]Instrumentation to instrument missing services
262262
// Use Nuget to find different instrumentation libraries
263-
.AddHttpClientInstrumentation(opts =>
264-
// This filter prevents background (parent-less) http client activity
265-
opts.Filter = req => Activity.Current?.Parent != null)
263+
.AddHttpClientInstrumentation(opts =>
264+
{
265+
// This filter prevents background (parent-less) http client activity
266+
opts.FilterHttpRequestMessage = req => Activity.Current?.Parent != null;
267+
opts.FilterHttpWebRequest = req => Activity.Current?.Parent != null;
268+
})
266269
.AddAspNetCoreInstrumentation()
267270
// Use AddSource to add your custom DiagnosticSource source names
268271
//.AddSource("My.Source.Name")

0 commit comments

Comments
 (0)