Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AzureMonitorExporter] cleanup nullable in Exporter classes and Transmitter #33962

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

TimothyMothra
Copy link
Contributor

@TimothyMothra TimothyMothra commented Feb 7, 2023

Towards #34013

Changes

  • remove #nullable disable in Exporter classes and resolve issues
  • remove #nullable disable in Transmitter class and resolve issues

Notes

The biggest change here is that the AzureMonitorResource in the Exporter could be null.
This is provided to the TelemetryItem constructor which is eventually used to set Tags.
The Tags were already checking for null so I think this change is safe.

private void SetResourceSdkVersionAndIkey(AzureMonitorResource? resource, string instrumentationKey)
{
InstrumentationKey = instrumentationKey;
Tags[ContextTagKeys.AiCloudRole.ToString()] = resource?.RoleName;

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@TimothyMothra TimothyMothra changed the title [AzureMonitorExporter] cleanup nullable in Exporter classes [AzureMonitorExporter] cleanup nullable in Exporter classes and Transmitter Feb 7, 2023
Copy link
Contributor

@rajkumar-rangaraj rajkumar-rangaraj left a comment

Choose a reason for hiding this comment

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

LGTM.

@vishweshbankwar Could you please take a look and confirm.

@TimothyMothra TimothyMothra merged commit 3e25f14 into main Feb 7, 2023
@TimothyMothra TimothyMothra deleted the tilee/nullable3 branch February 7, 2023 23:43
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.

4 participants