This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
When deploying an application to Azure App Service with CORS enabled, traces generated by OpenTelemetry.Instrumentation.AspNetCore are not being created. Changing the exporter has no effect on this behavior. However, traces from other sources, such as EntityFrameworkCore and HttpClient instrumentation, are successfully exported.
The key difference between requests when CORS is enabled versus disabled in App Service is the presence of the traceparent header (e.g., traceparent: 00-63beafd20fc56a364971ebee560f6e9c-ad151c22e8fbe470-00). This header seems to be the likely cause of the missing traces when CORS is active.
Component
OpenTelemetry.Instrumentation.AspNetCore
Package Version
Runtime Version
net8.0
Description
When deploying an application to Azure App Service with CORS enabled, traces generated by OpenTelemetry.Instrumentation.AspNetCore are not being created. Changing the exporter has no effect on this behavior. However, traces from other sources, such as EntityFrameworkCore and HttpClient instrumentation, are successfully exported.
The key difference between requests when CORS is enabled versus disabled in App Service is the presence of the traceparent header (e.g., traceparent: 00-63beafd20fc56a364971ebee560f6e9c-ad151c22e8fbe470-00). This header seems to be the likely cause of the missing traces when CORS is active.
Steps to Reproduce
When CORS is enabled, additional headers are introduced: traceparent: 00-63beafd20fc56a364971ebee560f6e9c-ad151c22e8fbe470-00 Content-Length: 0
You can see my sample app here https://github.com/wallyrion/OpenTelemetry.AppService.CorsIssue
Expected Result
I'm not sure about the expected behaviour here.
Actual Result
Http traces are not created and this is not obvious at all.
Additional Context
No response