Skip to content

Fix AOT warning regression in Azure.Monitor.OpenTelemetry.Exporter#56368

Merged
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
eerhardt:FixAzureMonitorAOT
Feb 20, 2026
Merged

Fix AOT warning regression in Azure.Monitor.OpenTelemetry.Exporter#56368
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
eerhardt:FixAzureMonitorAOT

Conversation

@eerhardt
Copy link
Copy Markdown
Member

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

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
Copilot AI review requested due to automatic review settings February 20, 2026 16:59
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Feb 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rajkumar-rangaraj
Copy link
Copy Markdown
Member

Thanks @eerhardt for covering it.

@rajkumar-rangaraj rajkumar-rangaraj merged commit ff05893 into Azure:main Feb 20, 2026
22 checks passed
@eerhardt eerhardt deleted the FixAzureMonitorAOT branch February 20, 2026 22:34
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Azure.Monitor.OpenTelemetry.Exporter 1.6.0 has new AOT warnings

3 participants