[BUG] Instrumentation Options delegates get called multiple times #46824
Labels
Client
This issue points to a problem in the data-plane of the library.
Monitor - Distro
Monitor OpenTelemetry Distro
Library name and version
Azure.Monitor.OpenTelemetry.AspNetCore
Describe the bug
The AzureMonitor Distro (Azure.Monitor.OpenTelemetry.AspNetCore) automatically includes some Instrumentation libraries.
If a user adds the same Instrumentation library again, we expect there should be no conflict.
Unfortunately, it seems that the delegate methods can get executed multiple times.
This has only been confirmed with the AspNetCore Instrumentation's EnrichWithHttpRequest library, but I suspect it applies to each Instrumentation library.
Example
Workaround
The workaround is to use the
Configure
Api to set an Instrumentation library's options.This is already described in our Readme and public docs, but users are not discovering this pattern and doing the above instead.
Expected behavior
N/A
Actual behavior
N/A
Reproduction Steps
N/A
Environment
No response
The text was updated successfully, but these errors were encountered: