Skip to content

Don't truncate gen ai custom dimensions#48385

Merged
harsimar merged 3 commits intomainfrom
harskaur/genAiTruncate
Mar 12, 2026
Merged

Don't truncate gen ai custom dimensions#48385
harsimar merged 3 commits intomainfrom
harskaur/genAiTruncate

Conversation

@harsimar
Copy link
Member

This PR iterates through custom dimensions to ensure that gen ai properties don't get truncated.

@github-actions github-actions bot added the Monitor - Autoconfigure Monitor OpenTelemetry Autoconfigure label Mar 11, 2026
@harsimar harsimar marked this pull request as ready for review March 11, 2026 22:08
Copilot AI review requested due to automatic review settings March 11, 2026 22:08
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

This PR updates the telemetry-building logic in azure-monitor-opentelemetry-autoconfigure to avoid truncating certain gen_ai.* custom dimension values, which can legitimately be much larger than the standard property value limit.

Changes:

  • Add a truncation exemption list for specific gen_ai.* property keys in AbstractTelemetryBuilder.addProperty().
  • Add unit tests validating standard truncation behavior and the new gen_ai.* non-truncation behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.../builders/AbstractTelemetryBuilder.java Skips 8192-char truncation for a fixed set of gen_ai.* property keys.
.../builders/AbstractTelemetryBuilderTest.java Adds coverage for regular truncation vs. truncation-exempt gen_ai.* property keys.

You can also share your feedback on Copilot code review. Take the survey.

…/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/builders/AbstractTelemetryBuilderTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@harsimar harsimar merged commit 347e35c into main Mar 12, 2026
19 checks passed
@harsimar harsimar deleted the harskaur/genAiTruncate branch March 12, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Autoconfigure Monitor OpenTelemetry Autoconfigure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants