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

One-name-fits-all-protocols endpoint parameter is potentially misleading for OTLP/gRPC #10893

Open
ghannington-Rocket opened this issue Aug 15, 2024 · 0 comments

Comments

@ghannington-Rocket
Copy link

ghannington-Rocket commented Aug 15, 2024

This is a follow-on to issue #5319.

Problem

Googling for:

grpc url path

reveals some confusion about whether gRPC supports endpoint URLs with a path component.

From the OTLP gRPC Exporter README.md:

endpoint (no default): host:port to which the exporter is going to send OTLP trace data, using the gRPC protocol. The valid syntax is described here.

One might say—I acknowledge, with justification—it says it right there: host:port. Not host:port/path. End of discussion.

Still, "here" is the gRPC docs topic "gRPC Name Resolution", which states:

A fully qualified, self contained name used for gRPC channel construction uses URI syntax as defined in RFC 3986.

RFC 3986 defines syntax that includes path components.

Also:

  • The endpoint parameter name is used for other protocols, such as OTLP/HTTP, which do allow a path component. Users who have configured the exporter for OTLP/HTTP might bring incorrect expectations when setting endpoint for OTLP/gRPC. ("User beware"?)
  • According to the OTLP spec, "The default network port for OTLP/gRPC is 4317". I don't see anything in the exporter source code that would append :4317 to an endpoint value that only specifies a hostname.

Suggestion

I'm not seriously proposing the following change, just performing a thought experiment to illustrate a point: if, instead of the single parameter endpoint, the OTLP/gRPC exporter config exposed the separate parameters host (or hostname) and port:

  • port could be optional, defaulting to 4317, as per the OTLP spec. The user would only have to specify host.
  • There'd be less scope for confusion about whether the endpoint URL could contain a path component.

More pragmatically, the description of endpoint for OTLP/gRPC could be changed to:

  • Explicitly mention that a path component is not supported.
  • Remove, adjust, or otherwise qualify the reference to the gRPC docs topic that refers to RFC 3986, which (misleadingly, in the context of OTLP/gRPC) allows path components.

Reference

  • gRPC docs issue #1345, "Suggestion: Clarify that, in practice, user-configurable values for gRPC endpoint URLs do not support a path component, and why"
@ghannington-Rocket ghannington-Rocket changed the title One-name-fits-all-protocols endpoint parameter is potentially misleading for OTLP/gPRC One-name-fits-all-protocols endpoint parameter is potentially misleading for OTLP/gRPC Aug 15, 2024
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

No branches or pull requests

1 participant