Skip to content

otlptrace: treat unix-abstract env endpoints as insecure - #9261

Open
vignesh2027 wants to merge 1 commit into
open-telemetry:mainfrom
vignesh2027:fix/otlptrace-unix-abstract-env-insecure
Open

vignesh2027 wants to merge 1 commit into
open-telemetry:mainfrom
vignesh2027:fix/otlptrace-unix-abstract-env-insecure

Conversation

@vignesh2027

@vignesh2027 vignesh2027 commented Oct 22, 2026 •

Copy link
Copy Markdown

withEndpointScheme in internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl treats only http and unix endpoints as insecure. A unix-abstract:// endpoint set through OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT falls through to WithSecure, so the trace exporter enables TLS for a local abstract socket. The metric template already lists unix-abstract (#8862), so the trace and metric exporters behave differently for the same endpoint.

This adds unix-abstract to the insecure schemes in the trace template and regenerates the otlptracegrpc and otlptracehttp copies with go generate. The only generated changes are the one-line envconfig.go change and the new test case in both modules.

Testing:

Added a "Test Environment Unix Abstract Endpoint" case to the shared trace options test template, mirroring the existing unix case and the metric unix-abstract case. It fails on main in both modules (Insecure is false) and passes with the change.

go test -race ./..., golangci-lint run, go vet and gofmt are clean for exporters/otlp/otlptrace/otlptracegrpc and exporters/otlp/otlptrace/otlptracehttp.

withEndpointScheme in the shared trace config template only treated
"http" and "unix" as insecure. A unix-abstract:// endpoint set through
OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT fell
through to WithSecure, so the trace exporter turned TLS on for a local
abstract socket. The metric template already handles unix-abstract
since open-telemetry#8862.

Add unix-abstract to the insecure schemes in the template, regenerate
the otlptracegrpc and otlptracehttp copies, and add a test case.
@vignesh2027
vignesh2027 force-pushed the fix/otlptrace-unix-abstract-env-insecure branch from f1151d9 to 617d6b7 Compare October 22, 2026 07:47
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on maintainers · refreshed 2026-10-22 14:28 UTC

Merge when ready.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI 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.

🟢 Approval recommended

The narrow fix consistently updates the template and generated files, includes targeted regression coverage, and has no unresolved findings.

No open issues 🎉

What changed in this PR

This PR makes trace exporters treat environment-configured unix-abstract:// endpoints as insecure, aligning them with Unix endpoints and the metric exporter behavior established in #8862.

Changes:

  • Adds unix-abstract to the shared trace configuration’s insecure schemes.
  • Updates both generated exporters and adds regression coverage for insecure configuration and gRPC target preservation.
  • Documents the behavior change in the changelog.

No issues were identified. Reported test results were not independently rerun.

File Description
internal/​shared/​otlp/​otlptrace/​otlpconfig/​options_test.go.tmpl Adds the shared Unix abstract endpoint regression case.
internal/​shared/​otlp/​otlptrace/​otlpconfig/​envconfig.go.tmpl Classifies Unix abstract endpoints as insecure.
exporters/​otlp/​otlptrace/​otlptracehttp/​internal/​otlpconfig/​options_test.go Includes the generated regression case.
exporters/​otlp/​otlptrace/​otlptracehttp/​internal/​otlpconfig/​envconfig.go Applies the generated scheme-handling fix.
exporters/​otlp/​otlptrace/​otlptracegrpc/​internal/​otlpconfig/​options_test.go Includes the generated regression case.
exporters/​otlp/​otlptrace/​otlptracegrpc/​internal/​otlpconfig/​envconfig.go Applies the generated scheme-handling fix.
CHANGELOG.md Records the fix for both trace exporters.

Review effort: Balanced

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.4%. Comparing base (5968638) to head (617d6b7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #9261     +/-   ##
=======================================
- Coverage   89.4%   89.4%   -0.1%     
=======================================
  Files        346     346             
  Lines      22848   22848             
=======================================
- Hits       20443   20438      -5     
- Misses      2405    2410      +5     
Files with missing lines Coverage Δ
...ace/otlptracegrpc/internal/otlpconfig/envconfig.go 91.5% <ø> (ø)
...ace/otlptracehttp/internal/otlpconfig/envconfig.go 91.5% <ø> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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