Skip to content

Conversation

jaymell
Copy link
Contributor

@jaymell jaymell commented Feb 17, 2024

Make endpoint Uri construction less fragile by stripping out duplicate slashes.

Fixes #997

Changes

The functionality to append the signal path to a user-supplied tracing endpoint is already in place. However, it does so in a way that is likely to break for any user who's passing the string value of a Uri or Url, which will have a trailing slash appended to them. This attempts to fix that issue.

There were other possible changes discussed but ever implemented/merged in #1056. This PR attempts to keep it simple by just changing existing behavior to not break in a common use case.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

Make endpoint Uri construction less fragile by stripping
out duplicate slahes.
@jaymell jaymell requested a review from a team February 17, 2024 18:50
Copy link

codecov bot commented Feb 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1be83bb) 65.8% compared to head (2caa7b1) 65.8%.

❗ Current head 2caa7b1 differs from pull request most recent head 2213bfa. Consider uploading reports for the commit 2213bfa to get more accurate results

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1553   +/-   ##
=====================================
  Coverage   65.8%   65.8%           
=====================================
  Files        140     140           
  Lines      19505   19518   +13     
=====================================
+ Hits       12841   12854   +13     
  Misses      6664    6664           

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

Copy link
Contributor

@hdost hdost left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

@hdost hdost merged commit 4c22cf6 into open-telemetry:main Feb 18, 2024
@jaymell jaymell deleted the better-otel-endpoint-construction branch February 22, 2024 19:13
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.

opentelemetry-otlp: '/v1/traces' is not appended to endpoint for http exporter

4 participants