Skip to content

Simplify endpoint #103

Closed
Closed
@marcalff

Description

@marcalff

The existing environment variables used in the spec to describe an endpoint:

  • OTEL_EXPORTER_OTLP_PROTOCOL
  • OTEL_EXPORTER_OTLP_ENDPOINT
  • OTEL_EXPORTER_OTLP_INSECURE

are the result of incremental design, due to history.

The current design for config.yaml derives from this existing specification, and currently is:

otlp:
  # http/protobuf, http/json, or grpc
  protocol:

  # http endpoint, https endpoint, or no scheme
  endpoint:

  # true or false, only used for grpc protocol with no scheme endpoint
  insecure: 

Exposing the same fields to match the existing environment variables has some merits, but also carries over existing issues.

Existing configuration

  1. Protocol

The protocol to use should be in the endpoint URL.
Instead, when using grpc, the "protocol" is set to "grpc", while the endpoint may contain "http" or "https".
This makes no sense.

  1. Message format

The message format, "protobuf" or "json", is mixed with the protocol.
I don't think it belongs there.

  1. Security

The "insecure" field is a last resort configuration parameter for grpc when not used with http/https.
This is too convoluted.

  1. Lack or orthogonality

With the existing configuration, if someone changes the protocol between http and grpc, then the following fields must be adjusted as well:

  • endpoint needs to be fixed for the port number
  • endpoint needs to be fixed to add or remove the /v1/{signal} path
  • the endpoint http/https scheme might be missing when coming from grpc, and needs to be fixed
  • the insecure field may be used or not, adding general confusion. insecure=false may still be insecure.

Proposed configuration

otlp:
  # Valid values are "protobuf" or "json".
  content_type: protobuf

  # Full URL with:
  # - a scheme ("http", "https", "grpc", "grpcs")
  # - a host name
  # - a port number
  # - an optional path, for http
  endpoint:

Examples of configuration:

otlp:
  content_type: protobuf
  endpoint: "http://localhost:4318/v1/traces"
otlp:
  content_type: json
  endpoint: "https://localhost:4318/v1/traces"
otlp:
  content_type: protobuf
  endpoint: "grpc://localhost:4317"
otlp:
  content_type: protobuf
  endpoint: "grpcs://localhost:4317"

Note how this simplifies things, as the endpoint URL specifies:

  • the protocol to use, HTTP versus gRPC
  • if TLS is used, with http / grpc versus https / grpcs

all this in the same field.

It then becomes much easier to change from:

  endpoint: "grpc://localhost:4317"

to

  endpoint: "https://localhost:4318/v1/traces"

when editing a config file, or when providing substitution variables.

General considerations

Note that I am NOT asking to change existing environment variables in the specs, as this will have some global impact on all SIG and all existing deployments.

This ship has sailed.

What I am asking to consider, is to have a different design for config.yaml only, which I think makes more sense and will be more practical to work with in the long term.

Given that there are no existing deployments using config.yaml, there is no impact if done at this stage.

The migration to config.yaml will not be any more complex, mapping to the new content_type and endpoint fields is trivial.

I think we should take this opportunity to simplify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions