Skip to content

Conversation

@JacksonWeber
Copy link
Contributor

This pull request improves how the AKSLoader class detects and configures the OTLP metric exporter based on the OTEL_METRICS_EXPORTER environment variable. The main change is to ensure that "otlp" is recognized correctly when specified as a comma-separated value among other exporters, and not as part of another word. Several new unit tests were added to verify this behavior for different scenarios.

Logic improvements to OTLP exporter detection:

  • Updated AKSLoader to check for "otlp" as a distinct value in the OTEL_METRICS_EXPORTER environment variable, supporting comma-separated lists and ignoring partial matches (e.g., "otlp-custom" does not trigger the exporter). (src/agent/aksLoader.ts)

Expanded test coverage for exporter detection:

  • Added unit tests to verify that the OTLP metric reader is created when "otlp" appears in various positions (beginning, middle, end) and with spaces in the OTEL_METRICS_EXPORTER value. (test/unitTests/agent/aksLoader.tests.ts)
  • Added tests to confirm that the OTLP metric reader is not created when "otlp" is absent or only present as part of another word (e.g., "otlp-custom"). (test/unitTests/agent/aksLoader.tests.ts)

);

// Create metricReaders array and add OTLP reader if environment variables request it
try {
Copy link
Member

Choose a reason for hiding this comment

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

No changelog update? Or did I miss it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This project does not have a changelog. Open to adding one in another PR.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, if it makes sense to have a CHANGELOG for these changes, then adding that to another PR sounds like a plan.

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

@JacksonWeber JacksonWeber merged commit da01c4d into microsoft:main Sep 29, 2025
16 of 26 checks passed
@rads-1996 rads-1996 mentioned this pull request Sep 29, 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