Azure / azure-webjobs-sdk

Azure WebJobs SDK
MIT License
737 stars 358 forks source link

OpenTelemetry Distributed Tracing Feature Support #3065

Open RyanThomas73 opened 6 months ago

RyanThomas73 commented 6 months ago

Currently the webjobs sdk only appears to support distributed tracing when explicitly using the webjob application insights logger.

Using the open telemetry SDKs, including the AzureMonitor exporter which writes to application insights, result in no diagnostic activity being started for the function execution and the corresponding context links to the upstream services are unavailable in application insights.

Feature Request

Support distributed tracing activities using the open telemetry compatible ActivitySource and Activity in usage scenarios beyond just the webjob specific application insights logger implementation.

Related information

smfields commented 2 months ago

This is called out in the original post, but maybe not explicitly clear.

Webjobs tracing, such as request and dependency tracing, is dependent on using the application insights logger.

Outside of OpenTelemetry, this also impacts scenarios where an alternate logger provider is used, such as Serilog. This feels quite unintuitive since it seems like switching the LoggerProvider should only affect logs, but it seems like all telemetry is tied into the application insights logger provider.