Skip to content

otlploghttp: normalize global endpoint path joining - #8864

Open
RedZapdos123 wants to merge 7 commits into
open-telemetry:mainfrom
RedZapdos123:fix-otlploghttp-trailing-slash-path
Open

otlploghttp: normalize global endpoint path joining#8864
RedZapdos123 wants to merge 7 commits into
open-telemetry:mainfrom
RedZapdos123:fix-otlploghttp-trailing-slash-path

Conversation

@RedZapdos123

Copy link
Copy Markdown
Contributor

Description:

Issue #8863 reported that otlploghttp could build a double-slash request path when the global OTEL_EXPORTER_OTLP_ENDPOINT base URL ended with a trailing slash.

convPath currently appends "/v1/logs" directly to u.Path, so a base endpoint like http://host/prefix/ resolves to /prefix//v1/logs.

This PR normalizes the global OTLP endpoint path join for otlploghttp and adds a regression test covering a trailing-slash base endpoint.

It does not change WithEndpointURL behavior.

Closes #8863.

Verifications:

  • cd exporters/otlp/otlplog/otlploghttp && go test . -run TestNewConfig -count=1 -v
  • cd exporters/otlp/otlplog/otlploghttp && go test . -count=1
  • cd exporters/otlp/otlplog/otlploghttp && go test ./... -count=1

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.5%. Comparing base (d093c45) to head (6b7dc58).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #8864     +/-   ##
=======================================
- Coverage   88.5%   88.5%   -0.1%     
=======================================
  Files        331     331             
  Lines      21013   21013             
=======================================
- Hits       18603   18602      -1     
- Misses      2410    2411      +1     
Files with missing lines Coverage Δ
exporters/otlp/otlplog/otlploghttp/config.go 96.2% <100.0%> (ø)

... and 3 files with indirect coverage changes

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

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
…iling-slash-path

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>

# Conflicts:
#	CHANGELOG.md
@MrAlias MrAlias added this to the v1.47.0 milestone Aug 31, 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.

otlploghttp: global OTLP endpoint with trailing slash produces double-slash path

3 participants