Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle trailing slash on endpoint for otlphttp #8083

Merged
merged 8 commits into from
Jul 13, 2023

Conversation

cartermp
Copy link
Contributor

@cartermp cartermp commented Jul 12, 2023

This makes it so we don't put a double slash on the endpoint for otlphttp when it exists.

The spec says that this kind of stuff should be handled w.r.t. the OTEL_EXPORTER_OTLP_ENDPOINT env var and says nothing about programmatic handling of this config. But I still think it's a worthwhile change on a common-ish[1] ergonomic issue.

[1] while the collector isn't the only source of this, at honeycomb we emitted an error related to a misconfigured otlphttp endpoint ~2.5 million times over the past month

fixes #8084

@cartermp cartermp requested review from a team and dmitryax July 12, 2023 16:51
@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (3f71668) 90.70% compared to head (20cc277) 90.70%.

❗ Current head 20cc277 differs from pull request most recent head 11ca87c. Consider uploading reports for the commit 11ca87c to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8083   +/-   ##
=======================================
  Coverage   90.70%   90.70%           
=======================================
  Files         300      300           
  Lines       15164    15167    +3     
=======================================
+ Hits        13754    13757    +3     
  Misses       1128     1128           
  Partials      282      282           
Impacted Files Coverage Δ
exporter/otlphttpexporter/factory.go 87.23% <100.00%> (+0.42%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

@cartermp please add a changelog entry by running make chlog-new.

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

Also please add some new tests to factory_test.go to test this behavior.

@cartermp
Copy link
Contributor Author

testing.go:1446: race detected during execution of test

did I do this or is this just kinda a thing sometimes?

.chloggen/otlphttpexporter-trailing-slash.yaml Outdated Show resolved Hide resolved
.chloggen/otlphttpexporter-trailing-slash.yaml Outdated Show resolved Hide resolved
exporter/otlphttpexporter/factory_test.go Outdated Show resolved Hide resolved
exporter/otlphttpexporter/factory_test.go Outdated Show resolved Hide resolved
exporter/otlphttpexporter/factory_test.go Outdated Show resolved Hide resolved
exporter/otlphttpexporter/factory_test.go Outdated Show resolved Hide resolved
codeboten and others added 2 commits July 12, 2023 13:49
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
@codeboten codeboten merged commit 11effd3 into open-telemetry:main Jul 13, 2023
@github-actions github-actions bot added this to the next release milestone Jul 13, 2023
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.

Handle trailing slash on endpoint for otlphttp
3 participants