Fix AOT warning regression in Azure.Monitor.OpenTelemetry.Exporter#56368
Merged
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom Feb 20, 2026
Merged
Fix AOT warning regression in Azure.Monitor.OpenTelemetry.Exporter#56368rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
Conversation
With change Azure#54942, new AOT warnings are being introduced due to using ConfigurationBinder Bind calls without using the source generator. Prior to that, this warning was suppressed, which wasn't correct either. The real fix is to use the source generator. Fix Azure#56365
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate newly introduced NativeAOT/trimming warnings in Azure.Monitor.OpenTelemetry.Exporter by switching configuration binding to the .NET configuration binding source generator approach (instead of suppressing warnings around ConfigurationBinder.Bind).
Changes:
- Removes the trimming/AOT suppression wrapper method around configuration binding.
- Enables the configuration binding source generator in the project file and suppresses generator-emitted SYSLIB warnings for non-bindable properties.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/DefaultAzureMonitorExporterOptions.cs | Removes the suppression-wrapped configuration binding helper. |
| sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Azure.Monitor.OpenTelemetry.Exporter.csproj | Enables configuration binding source generation and suppresses SYSLIB1100/SYSLIB1101 warnings. |
...monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Azure.Monitor.OpenTelemetry.Exporter.csproj
Show resolved
Hide resolved
...monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Azure.Monitor.OpenTelemetry.Exporter.csproj
Outdated
Show resolved
Hide resolved
rajkumar-rangaraj
approved these changes
Feb 20, 2026
Member
|
Thanks @eerhardt for covering it. |
harsimar
added a commit
to harsimar/azure-sdk-for-net
that referenced
this pull request
Mar 27, 2026
…1 release Added PR links to existing entries and new changelog items: - Azure#57194: Gen-ai attribute truncation (256KB limit) - Azure#56813: Classic TelemetryContext tag mapping - Azure#56368: AOT warning regression fix - Azure#56891: ApplicationInsightsRestClientSettings PR link Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
harsimar
added a commit
that referenced
this pull request
Mar 27, 2026
* Update Azure.Monitor.OpenTelemetry.Exporter CHANGELOG for 1.7.0-beta.1 release Added PR links to existing entries and new changelog items: - #57194: Gen-ai attribute truncation (256KB limit) - #56813: Classic TelemetryContext tag mapping - #56368: AOT warning regression fix - #56891: ApplicationInsightsRestClientSettings PR link Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update Azure.Monitor.OpenTelemetry.Exporter to 1.7.0 GA and remove #56813 from changelog Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With change #54942, new AOT warnings are being introduced due to using ConfigurationBinder Bind calls without using the source generator. Prior to that, this warning was suppressed, which wasn't correct either.
The real fix is to use the source generator.
Fix #56365
NOTE: I can't re-enable AOT checks for this library because of #56367. We will need to fix that to re-enable the checks.
cc @m-redding @harsimar