-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Library name and version
Azure.Monitor.OpenTelemetry.AspNetCore 1.0.0-beta.6
Describe the bug
There's an unnecessary/nonsense object instantiation in the following code: builder.UseAzureMonitor(o => o = new AzureMonitorOptions()). The assignment has no impact on actual configured options instance, as it is a local lambda variable/parameter being "overwritten". It's a nonsense code in general.
Line 55 in a35f47a
| return builder.UseAzureMonitor(o => o = new AzureMonitorOptions()); |
Expected behavior
A null lambda is passed, or an empty-bodied lambda is passed. Preferable a null lambda, because then it won't be registered in DI container and take up space in options-configuration-pipeline. However, the API contract is non-nullable and so it might be unwanted. Were it nullable, I'd happily open a PR, but in current situation a decision is necessary.
Actual behavior
An essentially no-op lambda is passed (which creates a throw-away object instance in the process), and then gets registered into Options-configuration pipeline, which makes no sense.
Reproduction Steps
It's a code nitpick, non-reproducible.
Environment
Not applicable.