Skip to content

fix: extract codeAttributes from container_config.traces#199

Merged
tamirdavid1 merged 3 commits into
mainfrom
fix/extract-code-attributes-from-container-config
May 13, 2026
Merged

fix: extract codeAttributes from container_config.traces#199
tamirdavid1 merged 3 commits into
mainfrom
fix/extract-code-attributes-from-container-config

Conversation

@tamirdavid1

@tamirdavid1 tamirdavid1 commented May 13, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

The server sends codeAttributes inside the container_config config map entry at traces.codeAttributes, but get_remote_config only looked for it under the empty-string config_map key which the server never sends. This caused code attributes to always default to False.

Also renames the misleading sample_config field/variable to container_config since it holds the full container configuration, not just sampling config.

Changelog entry: Does this PR introduce a user-facing bug fix, feature, dependency update, or breaking change??

NONE

emergency-ticket id: EMR-1693

The server sends codeAttributes inside the container_config config map
entry at traces.codeAttributes, but get_remote_config only looked for
it under the empty-string config_map key which the server never sends.
This caused code attributes to always default to False.

Also renames the misleading sample_config field/variable to
container_config since it holds the full container configuration, not
just sampling config.
Comment thread opamp/http_client.py
Comment on lines +313 to +316
try:
config.span_metrics_mode = container_config['traces']['headSampling']['spanMetricsMode']
except (KeyError, TypeError):
pass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is it the idomatic way in python to check for properties in json which can be null?

@tamirdavid1 tamirdavid1 merged commit 5f3b1c0 into main May 13, 2026
15 of 18 checks passed
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.

2 participants