Skip to content

Comments

feat(telemetry): add resourceAttributes to OTLP backends#7972

Merged
cnvergence merged 5 commits intoenvoyproxy:mainfrom
codefromthecrypt:feat/telemetry-otel-headers-resources-tls
Jan 29, 2026
Merged

feat(telemetry): add resourceAttributes to OTLP backends#7972
cnvergence merged 5 commits intoenvoyproxy:mainfrom
codefromthecrypt:feat/telemetry-otel-headers-resources-tls

Conversation

@codefromthecrypt
Copy link
Contributor

@codefromthecrypt codefromthecrypt commented Jan 16, 2026

What type of PR is this?
feat(telemetry): add new feature

What this PR does / why we need it:
Adds support for resource attributes on OTLP metrics and tracing sinks, enabling callers like Envoy AI Gateway to map all attributes required for Elastic Cloud OTLP endpoints.

This completes the OTEL_RESOURCE_ATTRIBUTES equivalent for all three OTLP signals:

  • Access Logs: Deprecates resources field in favor of resourceAttributes (maps to Envoy's resource_attributes)
  • Tracing: New resourceAttributes field (maps to Envoy's resource_detectors with StaticConfigResourceDetector)
  • Metrics: New resourceAttributes field (maps to Envoy's resource_detectors with StaticConfigResourceDetector)

Example use case: Setting service.name, service.version, and deployment.environment for proper service identification in observability backends like Elastic APM.

otel-tui
Screenshot 2026-01-29 at 6 18 57 AM
Screenshot 2026-01-29 at 6 18 45 AM
Screenshot 2026-01-29 at 6 18 26 AM

Release Notes: Yes

@netlify
Copy link

netlify bot commented Jan 16, 2026

Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit 0c00e74
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/697b2828ae18f80008d0cf63

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.69%. Comparing base (c9e3d5f) to head (0c00e74).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/listener.go 86.66% 1 Missing and 1 partial ⚠️
internal/xds/translator/tracing.go 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7972      +/-   ##
==========================================
+ Coverage   73.65%   73.69%   +0.03%     
==========================================
  Files         239      240       +1     
  Lines       36311    36333      +22     
==========================================
+ Hits        26745    26775      +30     
+ Misses       7671     7662       -9     
- Partials     1895     1896       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codefromthecrypt codefromthecrypt marked this pull request as ready for review January 16, 2026 06:49
@codefromthecrypt codefromthecrypt requested a review from a team as a code owner January 16, 2026 06:49
@axw
Copy link

axw commented Jan 16, 2026

@codefromthecrypt can you see any docs in traces-*? If there are, can you grab one so I can see what it looks like? Might be an issue with the UI/data contract

@axw
Copy link

axw commented Jan 16, 2026

Thanks, so definitely seems to be an issue with the fields...

Nothing obvious jumps out. If you're able to grab an OTLP dump (OTLP/JSON is fine if easier to drop here) then I can try to reproduce and see what's up (probably on Monday).

zirain
zirain previously approved these changes Jan 18, 2026
@codefromthecrypt codefromthecrypt force-pushed the feat/telemetry-otel-headers-resources-tls branch from 89fed9e to 1eeb986 Compare January 20, 2026 23:35
@zirain zirain changed the title feat(telemetry): add headers, resources, and TLS for OTLP backends feat(telemetry): add resources OTLP backends Jan 22, 2026
zirain
zirain previously approved these changes Jan 22, 2026
@codefromthecrypt
Copy link
Contributor Author

codefromthecrypt commented Jan 23, 2026

@zhaohuabing or anyone else can you please merge this? getting really close to otel working. aigw is still using console logs as this is missing and until it is there it won't be able to switch effectively as otel without consistent resource attrs isn't really useful. envoyproxy/ai-gateway#1808

ReportCountersAsDeltas: sink.ReportCountersAsDeltas,
ReportHistogramsAsDeltas: sink.ReportHistogramsAsDeltas,
Headers: sink.Headers,
Resources: sink.Resources,
Copy link
Contributor

Choose a reason for hiding this comment

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

is a similar change needed for k8s ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

next commit should fix that. thanks!

arkodg
arkodg previously approved these changes Jan 26, 2026
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@arkodg arkodg requested a review from zirain January 26, 2026 05:57
@arkodg arkodg added this to the v1.7.0-rc.1 Release milestone Jan 26, 2026
@zirain
Copy link
Member

zirain commented Jan 28, 2026

@codefromthecrypt can you fix the conflict?

@codefromthecrypt codefromthecrypt force-pushed the feat/telemetry-otel-headers-resources-tls branch from acc6be1 to d7e3b4a Compare January 28, 2026 09:47
zhaohuabing
zhaohuabing previously approved these changes Jan 28, 2026
@codefromthecrypt codefromthecrypt force-pushed the feat/telemetry-otel-headers-resources-tls branch from fa345d2 to 0a36a8d Compare January 28, 2026 20:58
@codefromthecrypt codefromthecrypt changed the title feat(telemetry): add resources OTLP backends feat(telemetry): add resourceAttributes to OTLP backends Jan 28, 2026
@codefromthecrypt codefromthecrypt force-pushed the feat/telemetry-otel-headers-resources-tls branch from 0a36a8d to 447a0f5 Compare January 28, 2026 21:09
@codefromthecrypt
Copy link
Contributor Author

@zhaohuabing @arkodg @zirain I deprecated the resources -> resourceAttributes in logs then made the two new ones resourceAttributes re-built and ran through the demo and updated the screen shots which show it works. PTAL 🤞

@codefromthecrypt codefromthecrypt force-pushed the feat/telemetry-otel-headers-resources-tls branch from 447a0f5 to e5b7349 Compare January 28, 2026 23:31
zirain
zirain previously approved these changes Jan 28, 2026
@zhaohuabing
Copy link
Member

@zhaohuabing @arkodg @zirain I deprecated the resources -> resourceAttributes in logs then made the two new ones resourceAttributes re-built and ran through the demo and updated the screen shots which show it works. PTAL 🤞
Great! Thanks!

zhaohuabing
zhaohuabing previously approved these changes Jan 29, 2026
Added support for:
- Custom headers on OTLP exports (metrics, tracing, access logs)
- Resource attributes on OTLP metrics and tracing sinks via the resources field
- TLS telemetry gRPC backends

Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt codefromthecrypt dismissed stale reviews from zhaohuabing and zirain via f2b32a0 January 29, 2026 05:11
@codefromthecrypt codefromthecrypt force-pushed the feat/telemetry-otel-headers-resources-tls branch from e5b7349 to f2b32a0 Compare January 29, 2026 05:11
@codefromthecrypt
Copy link
Contributor Author

rebased

@cnvergence
Copy link
Member

/retest

1 similar comment
@cnvergence
Copy link
Member

/retest

@cnvergence cnvergence merged commit ab6a3cf into envoyproxy:main Jan 29, 2026
71 of 75 checks passed
@codefromthecrypt codefromthecrypt deleted the feat/telemetry-otel-headers-resources-tls branch January 29, 2026 22:21
SadmiB pushed a commit to SadmiB/gateway that referenced this pull request Jan 30, 2026
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.

6 participants