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

Remove scheme from OTLP endpoint before passing to gRPC #988

Merged
merged 5 commits into from
Sep 21, 2021

Conversation

ThomsonTan
Copy link
Contributor

Fixes #986

Changes

According to https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md, URI scheme like http or https are allowed in the OTLP endpoint, but causes problem in naming resolving in gRPC. This change removes the URI scheme for OTLP gRPC.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@ThomsonTan ThomsonTan requested a review from a team September 21, 2021 09:08
@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #988 (dfa0590) into main (530cb30) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #988   +/-   ##
=======================================
  Coverage   95.41%   95.41%           
=======================================
  Files         161      161           
  Lines        6833     6833           
=======================================
  Hits         6519     6519           
  Misses        314      314           

{
grpc_target = options.endpoint;
}

Copy link
Member

@lalitb lalitb Sep 21, 2021

Choose a reason for hiding this comment

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

Nit, we can also use UrlParser :

UrlParser url(options.endpoint);
if (url.success_) {
  grpc_target = url.host_ + ":" + url.port_;
}

This will validate that url is in correct format, and remove path and query_string if added ?

@ThomsonTan ThomsonTan merged commit b1f96c9 into open-telemetry:main Sep 21, 2021
@ThomsonTan ThomsonTan deleted the FixOtlpEndpoint branch September 21, 2021 23:40
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.

The default OTLP endpoint doesn't work for the OTLP exporter
2 participants