-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add path prefix for otlp http receiver #7570
Add path prefix for otlp http receiver #7570
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #7570 +/- ##
==========================================
- Coverage 90.96% 90.21% -0.75%
==========================================
Files 300 301 +1
Lines 15090 15402 +312
==========================================
+ Hits 13726 13895 +169
- Misses 1091 1221 +130
- Partials 273 286 +13
☔ View full report in Codecov by Sentry. |
d9cd449
to
27a51e2
Compare
LGTM. The only thing is maybe this should be offered at the confighttp.HTTPServerSettings level? A maintainer should have a better view. |
Looking over this, yeah I agree. This would be better served having the Edit: @atoulme might have leaned a bit too far over my skis here. Is the above what you meant? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change, especially as it's forward-compatible with a possible generalization of the path prefix into the HTTPServerSettings. Given that no other receivers would use the path prefix, I'm against adding it directly there.
Let's add it only for OTLP Receiver, see the feedback, and generalize it if needed.
01248de
to
9d68924
Compare
@jpkrohling ok, I've made the updates you requested. |
@jpkrohling @atoulme @fredthomsen please make sure we are consistent with the exporter option do configure this, see https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlphttpexporter/config.go#L26 I think we should do something like that instead, since the next request will be to change the "fixed" path. So I think in terms of something like having the full path |
So, I think there is two options here:
|
0bab580
to
c561cf9
Compare
Having two ways to configure something is usually confusing and harder to maintain. I would just vote for having per signal path, as proven in the exporter users did not complain about the ability (yet) to have a prefix, and we can always add that if we get such strong feedback that it is necessary to have that and that per signal is not working to them. |
I agree that the ideal is to have three endpoints for the HTTP receiver as well. |
f7857c6
to
5f60165
Compare
@jpkrohling @bogdandrutu I've moved to three separate url path configurations. I was waffling between validating the path config up front or not given that there is a panic caused by an invalid path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I tested with a config like this:
receivers:
otlp/1:
protocols:
grpc:
otlp/2:
protocols:
http:
traces_url_path: /traces
exporters:
otlphttp/2:
traces_endpoint: http://localhost:4318/traces
logging:
service:
pipelines:
traces/1:
receivers: [ otlp/1 ]
processors:
exporters: [ otlphttp/2 ]
traces/2:
receivers: [ otlp/2 ]
processors:
exporters: [ logging ]
I did have some trouble in finding the right config, so perhaps the following could be added to the readme:
- explicitly mention in the readme how and where to set the endpoints. This is optional, as people can look into the test data for reference
- state that, on the other side, the OTLP HTTP exporter should use the similar attributes for an end-to-end solution.
I wasn't able to get the SDK to work with this, including the telemetrygen. If you can make it work with that, it would be worth adding instructions here as well.
Those are things that can be done in a follow-up PR. This one here LGTM.
626153e
to
4f36323
Compare
There was information in the README present already, but it had the incorrect configuration parameter names. I have updated them now.
Agreed. I have added this information.
I am not too familiar w/telemetrygen, so yeah let's tackle that in a follow up. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Supports multiple otlp recivers running behind a reverse proxy/ingress by setting up different paths. Fixes open-telemetry#7511
Updated per PR feedback to normalize URLs
Surprised to see these unit test failures as locally my runs are working fine. |
I stand corrected. I see it now.
|
c8ed288
to
7867a90
Compare
@open-telemetry/collector-maintainers, would one of you please review/merge this one? |
Co-authored-by: Alex Boten <alex@boten.ca>
Description:
Supports multiple otlp http receivers running behind a reverse proxy/ingress.
Fixes #7511
Testing:
Updated existing tests to account for new parameter.
Documentation:
Added documentation for configuring prefix in the receiver README.