Skip to content

otlp: switch to UTR endpoint#2186

Merged
ridwanmsharif merged 3 commits into
westphalrafael/otlp_exporter_config_knobfrom
ridwanmsharif/otlp-traces
Jun 11, 2026
Merged

otlp: switch to UTR endpoint#2186
ridwanmsharif merged 3 commits into
westphalrafael/otlp_exporter_config_knobfrom
ridwanmsharif/otlp-traces

Conversation

@ridwanmsharif

@ridwanmsharif ridwanmsharif commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Adds option to send traces to UTR endpoint instead. No-op by default.

@github-actions

Copy link
Copy Markdown

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Mar 25, 2026
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/otlp-traces branch from f4cb869 to 335bdfc Compare June 9, 2026 19:56
@ridwanmsharif ridwanmsharif marked this pull request as ready for review June 9, 2026 19:59
@XuechunHou

Copy link
Copy Markdown
Contributor

Can you merge this PR with #2292?

In #2292 Rafael added a global config knob to turn on and off UTR for metrics and logs. We could reuse that config for trace.

Can you add a few commits to Rafa's PR, adding the processors needed for trace UTR, the OTLP exporter configuration for the trace endpoint (https://github.com/GoogleCloudPlatform/ops-agent/pull/2186/changes#diff-bcf4db7b1ead9873183e1c4b42f5022443169df5866d48e713032a239e9d74f6), and the integration tests. Leave out the trace-only config in this PR. Thanks

@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/otlp-traces branch from f3a3e9e to 440c4f2 Compare June 10, 2026 21:46
@ridwanmsharif ridwanmsharif changed the base branch from master to westphalrafael/otlp_exporter_config_knob June 10, 2026 21:47
if _, ok := span.Labels["g.co/r/gce_instance/instance_id"]; ok {
t.Errorf("Unexpected legacy attribute g.co/r/gce_instance/instance_id found in span %q", span.Name)
}
if val, ok := span.Labels["custom.resource.attribute"]; ok {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I dont think foundResourceAttr, foundSpanAttr variables are needed here.
the logic can be simplified to

val, ok := span.Labels["custom.resource.attribute"]

if !ok 
{ t.Errorf(t.Error("Resource attribute 'custom.resource.attribute' not found in trace spans"))}

if val !=  "my-resource-value" {
t.Errorf("Expected custom.resource.attribute to be 'my-resource-value', got %q", val)

}

t.Errorf("Expected custom.resource.attribute to be 'my-resource-value', got %q", val)
}
}
if val, ok := span.Labels["custom.span.attribute"]; ok {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here i think we can simplify this logic and avoid the foundSpanAttr variable.

@rafaelwestphal rafaelwestphal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ridwanmsharif ridwanmsharif merged commit 4b7407c into westphalrafael/otlp_exporter_config_knob Jun 11, 2026
70 of 74 checks passed
@ridwanmsharif ridwanmsharif deleted the ridwanmsharif/otlp-traces branch June 11, 2026 18:22
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