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

Fix default URL for OTLP Trace/Metrics for http/protobuf #3098

Merged
merged 5 commits into from
Apr 5, 2022

Conversation

pjanotti
Copy link
Contributor

Changes

Setting only the protocol to http/protobuf wasn't enough to get the OTLP exporters, trace and metrics, sending to the correct endpoint. Setting the env var or the property directly works, but, it should just work by setting the protocol.

@pjanotti pjanotti requested a review from a team March 28, 2022 17:45
@codecov
Copy link

codecov bot commented Mar 28, 2022

Codecov Report

Merging #3098 (b1b6997) into main (d3c0c6e) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3098      +/-   ##
==========================================
- Coverage   84.74%   84.64%   -0.10%     
==========================================
  Files         259      259              
  Lines        9236     9228       -8     
==========================================
- Hits         7827     7811      -16     
- Misses       1409     1417       +8     
Impacted Files Coverage Δ
...orter.OpenTelemetryProtocol/OtlpExporterOptions.cs 100.00% <ø> (ø)
...TelemetryProtocol/OtlpExporterOptionsExtensions.cs 97.67% <ø> (-0.13%) ⬇️
...nTelemetryProtocol/OtlpMetricExporterExtensions.cs 67.85% <ø> (-1.11%) ⬇️
...metryProtocol/OtlpTraceExporterHelperExtensions.cs 90.47% <ø> (-0.44%) ⬇️
...mentation/ExportClient/BaseOtlpHttpExportClient.cs 100.00% <100.00%> (ø)
...tation/ExportClient/OtlpHttpMetricsExportClient.cs 62.50% <100.00%> (-4.17%) ⬇️
...entation/ExportClient/OtlpHttpTraceExportClient.cs 87.50% <100.00%> (-2.98%) ⬇️
...xporter.OpenTelemetryProtocol/OtlpTraceExporter.cs 36.36% <0.00%> (-22.73%) ⬇️
...entation/ExportClient/OtlpGrpcTraceExportClient.cs 35.71% <0.00%> (-14.29%) ⬇️
...mentation/ExportClient/BaseOtlpGrpcExportClient.cs 50.00% <0.00%> (-11.12%) ⬇️

@pjanotti
Copy link
Contributor Author

pjanotti commented Mar 28, 2022

🤔 the tests passed locally, need to look...

ah, incorrect assumption of my part: I thought that these tests were running against the localhost and my setup used that, likely I need a better place to test this.

@pjanotti
Copy link
Contributor Author

I had a conversation with @pellared and will be updating the PR: I will be trying to remove the extension method that already does some checks regarding the path for the exporters.

@pellared pellared marked this pull request as draft March 28, 2022 20:03
@pellared pellared changed the title Fix default URL for OTLP Trace/Metrics for http/protobuf [WIP] Fix default URL for OTLP Trace/Metrics for http/protobuf Mar 28, 2022
@pjanotti pjanotti force-pushed the fix_otlp_default_endpoint branch from 8d02672 to ff5fbf6 Compare March 28, 2022 23:30
@pjanotti pjanotti marked this pull request as ready for review March 28, 2022 23:34
@pjanotti pjanotti changed the title [WIP] Fix default URL for OTLP Trace/Metrics for http/protobuf Fix default URL for OTLP Trace/Metrics for http/protobuf Mar 28, 2022
@cijothomas cijothomas added this to the 1.2.0 milestone Mar 30, 2022
@cijothomas
Copy link
Member

@pjanotti one conflict came another PR merge.. could you resolve that please?

@pjanotti pjanotti force-pushed the fix_otlp_default_endpoint branch from d50ea97 to 47485fe Compare April 1, 2022 17:53
@pjanotti pjanotti force-pushed the fix_otlp_default_endpoint branch from 47485fe to 010307f Compare April 1, 2022 18:05
@pjanotti
Copy link
Contributor Author

pjanotti commented Apr 1, 2022

Done @cijothomas

Copy link
Member

@alanwest alanwest left a comment

Choose a reason for hiding this comment

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

LGTM. Just a question about config precedence not really related specifically to this PR.

@pjanotti
Copy link
Contributor Author

pjanotti commented Apr 4, 2022

Thanks for the review @alanwest

@cijothomas @CodeBlanch ptal @ #3098 (comment)

@cijothomas
Copy link
Member

@pjanotti As as follow up, would you help modifying the examples to show how to use the http option?
For example: I think the collector needs to enable http support 1st...
https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/examples/Console/otlp-collector-example/config.yaml

Anything else?

@pjanotti
Copy link
Contributor Author

pjanotti commented Apr 5, 2022

Sure thing @cijothomas - I will run the examples locally and create a PR if needed. IIRC the OTLP receiver on the collector receives both grpc and http by default, but, as I said I will double-check if the examples are looking good for OTLP.

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.

5 participants