Skip to content

Conversation

@JacksonWeber
Copy link
Contributor

Per the spec https://github.com/aep-health-and-standards/Telemetry-Collection-Spec/blob/main/ApplicationInsights/AKS_AutoAttach_Metrics.md#sending-otel-metrics-to-amw the OTEL_METRICS_EXPORTER env var should be populated when in AKS auto-attach scenarios.

The OTel code that controls creation of the metric exporter in the even that this env var is populated exists here: https://github.com/open-telemetry/opentelemetry-js/blob/dac72912b3a895c91ee95cfa39a22a916411ba4c/experimental/packages/opentelemetry-sdk-node/src/sdk.ts#L115

Copy link
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

Removes manual setup of the OTLP metrics exporter in AKS auto-attach scenarios—relying instead on the OTEL_METRICS_EXPORTER environment handling—and drops the now-redundant test.

  • Deleted explicit otlpMetricExporterConfig.enabled logic
  • Removed the unit test for manual OTLP exporter creation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/unitTests/agent/aksLoader.tests.ts Dropped the test that asserted manual OTLP exporter addition
src/agent/aksLoader.ts Removed explicit OTLP exporter configuration setup
Comments suppressed due to low confidence (2)

test/unitTests/agent/aksLoader.tests.ts:62

  • After removing the old manual-exporter test, consider adding a new test to verify that the OTLP metric exporter is still initialized automatically by the SDK when the OTEL_METRICS_EXPORTER environment variable is set.
        assert.equal(loggerProvider["_sharedState"]["registeredLogRecordProcessors"][1]["_exporter"].constructor.name, "AzureMonitorLogExporter");

src/agent/aksLoader.ts:16

  • [nitpick] Add a brief comment or docstring here referencing the spec URL to explain that explicit OTLP exporter config was removed because the SDK now handles OTEL_METRICS_EXPORTER automatically in AKS auto-attach scenarios.
        if (this._canLoad) {

Copy link
Member

@rads-1996 rads-1996 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

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

LGTM

@JacksonWeber JacksonWeber merged commit ee1191e into microsoft:main Jun 20, 2025
16 checks passed
@JacksonWeber JacksonWeber mentioned this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants