Skip to content

Added a 256kb custom properties truncation limit on specific GenAI attributes#45749

Merged
rads-1996 merged 9 commits intoAzure:mainfrom
rads-1996:truncate-genai-attrbs-256
Mar 17, 2026
Merged

Added a 256kb custom properties truncation limit on specific GenAI attributes#45749
rads-1996 merged 9 commits intoAzure:mainfrom
rads-1996:truncate-genai-attrbs-256

Conversation

@rads-1996
Copy link
Member

@rads-1996 rads-1996 commented Mar 17, 2026

Description

The following GenAI attributes have a truncation limit of 256kb. All other custom properties will be truncated at 64kb as before -

- gen_ai.input.messages
- gen_ai.output.messages
- gen_ai.system_instructions
- gen_ai.tool.definitions
- gen_ai.tool.call.arguments
- gen_ai.tool.call.result
- gen_ai.evaluation.explanation

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings March 17, 2026 17:01
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Mar 17, 2026
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

Updates azure-monitor-opentelemetry-exporter custom property filtering so a specific allowlist of GenAI attributes is truncated at a higher limit (256 * 1024) while all other custom properties continue to truncate at the existing 64 * 1024 limit.

Changes:

  • Increase truncation limit for _GEN_AI_ATTRIBUTES values to 256 * 1024.
  • Update and extend unit tests to cover mixed attributes and the new 256KB/KiB truncation behavior.
  • Add a corresponding unreleased changelog entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py Applies a higher truncation cap for _GEN_AI_ATTRIBUTES in _filter_custom_properties.
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_utils.py Updates existing truncation tests and adds explicit coverage for GenAI truncation at 256 * 1024.
sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md Documents the new GenAI-specific truncation limit under unreleased features.

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

@rads-1996 rads-1996 force-pushed the truncate-genai-attrbs-256 branch from dc288b9 to 9d94fa7 Compare March 17, 2026 17:12
@rads-1996 rads-1996 force-pushed the truncate-genai-attrbs-256 branch from 4652eb2 to b4bab0e Compare March 17, 2026 20:13
@rads-1996 rads-1996 merged commit 706371c into Azure:main Mar 17, 2026
20 checks passed
@rads-1996 rads-1996 deleted the truncate-genai-attrbs-256 branch March 17, 2026 22:06
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