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

Update OTLP exporter configuration to conform to the specification #1085

Closed
3 tasks
MrAlias opened this issue Aug 24, 2020 · 12 comments · Fixed by #1821
Closed
3 tasks

Update OTLP exporter configuration to conform to the specification #1085

MrAlias opened this issue Aug 24, 2020 · 12 comments · Fixed by #1821
Assignees
Labels
pkg:exporter:otlp Related to the OTLP exporter package
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Aug 24, 2020

The following configuration options and the interpreted environment variables need to be implemented to support the specification

Configuration Option Description Default Env variable
Endpoint Target to which the exporter is going to send spans or metrics. This MAY be configured to include a path (e.g. example.com/v1/traces). localhost:55680 OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_SPAN_ENDPOINT OTEL_EXPORTER_OTLP_METRIC_ENDPOINT
Protocol The protocol used to transmit the data. One of grpc,http/json,http/proto. grpc OTEL_EXPORTER_OTLP_PROTOCOL OTEL_EXPORTER_OTLP_SPAN_PROTOCOL OTEL_EXPORTER_OTLP_METRIC_PROTOCOL
Insecure Whether to enable client transport security for the exporter's grpc or http connection. false OTEL_EXPORTER_OTLP_INSECURE OTEL_EXPORTER_OTLP_SPAN_INSECURE OTEL_EXPORTER_OTLP_METRIC_INSECURE
Certificate File Certificate file for TLS credentials of gRPC client. Should only be used if insecure is set to false. n/a OTEL_EXPORTER_OTLP_CERTIFICATE OTEL_EXPORTER_OTLP_SPAN_CERTIFICATE OTEL_EXPORTER_OTLP_METRIC_CERTIFICATE
Headers The headers associated with gRPC or HTTP requests. n/a OTEL_EXPORTER_OTLP_HEADERS OTEL_EXPORTER_OTLP_SPAN_HEADERS OTEL_EXPORTER_OTLP_METRIC_HEADERS
Compression Compression key for supported compression types. Supported compression: gzip no compression OTEL_EXPORTER_OTLP_COMPRESSION OTEL_EXPORTER_OTLP_SPAN_COMPRESSION OTEL_EXPORTER_OTLP_METRIC_COMPRESSION
Timeout Max waiting time for the backend to process each spans or metrics batch. 10s OTEL_EXPORTER_OTLP_TIMEOUT OTEL_EXPORTER_OTLP_SPAN_TIMEOUT OTEL_EXPORTER_OTLP_METRIC_TIMEOUT

Tasks

  • Update OTLP configuration to include all the options with defaults.
  • Update the OTLP exporter to use the appropriate environment variables to configure the exproter.
  • Update the compliance matrix when complete.
@MrAlias MrAlias added help wanted Extra attention is needed pkg:exporter labels Aug 24, 2020
@MrAlias MrAlias added this to the RC1 milestone Aug 27, 2020
@MrAlias
Copy link
Contributor Author

MrAlias commented Sep 3, 2020

This is blocked by #1121 and #1122

@MrAlias MrAlias changed the title Ensure the OTLP exporter configuration conforms to latest specification Update OTLP exporter configuration to conform to the specification Sep 3, 2020
@krnowak
Copy link
Member

krnowak commented Nov 11, 2020

I'll try to push it forward.

@Miriam-R
Copy link

This is waiting on a review & merge from @MrAlias

@krnowak
Copy link
Member

krnowak commented Dec 21, 2020

The code for this issue and #1121 and #1122 is here: https://github.com/krnowak/opentelemetry-go/tree/otlp-conn

@MrAlias MrAlias assigned MrAlias and unassigned krnowak Feb 16, 2021
@hermanbanken
Copy link

This seems to be unblocked. I would be great if the Golang version adheres to the spec 😄

I was investigating how the 2021 way of doing metrics should be, found OpenTelemetry, and following the DataDog guide they mention using OTEL_EXPORTER_OTLP_ENDPOINT while this is not actually supported by all implementations yet, I now learn.

The saddest part is that every individual developer needs to discover this from the source (I searched for OTEL_EXPORTER_OTLP_ENDPOINT). Or is spec-adherance-progress tracked somewhere central that I'm just overlooking?

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 12, 2021

@hermanbanken we are happy to accept contributions if you are looking to work on this issue. Please let me know if I can assign it to you. Also, please take a look at the linked project. It contains all the things the contributors of this project are working hard to resolve and release a compliant implementation of the 1.0.1 specification.

@paivagustavo
Copy link
Member

I came across some questions when implementing this. The specs defines that one could configure the exporter protocol, i.e., one could change between gRPC, http/proto and http/json via a config or env variable. But, currently, we have separated exporters implementation for gRPC and HTTP (otlpgrpc.Driver and otlphttp.Driver) and the user need to instante one or the other, making it impossible to dynamically change the protocol.

Since both exporters do implements the OTLP exporter interface, we could unify the configurations and choose which implementation should be used based on With configs or via env variables. The downside about this approach, is that we do define some configs that are only used by one of those exporters, e.g., the trace path and the metrics path only applies to the HTTP exporter and the reconnection period applies only to the gRPC exporter.

Would it be a problem to have configurations that only works when a specific implementation used? We could see this the same as some configs that overrides others, e.g, the Insecure options makes the tls config to be ignored, the same way that a gRPC option would make the tracePath to be ignored.

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 29, 2021

@paivagustavo it looks like that environment variable and configuration option moved to a "reserved" status, making the current requirements (1.1.0 of the spec):

Configuration Option Description Default Env variable
Endpoint Target to which the exporter is going to send spans or metrics. The endpoint MUST be a valid URL with scheme (http or https) and host, and MAY contain a port and path. A scheme of https indicates a secure connection. When using OTEL_EXPORTER_OTLP_ENDPOINT with OTLP/HTTP, exporters SHOULD follow the collector convention of appending the version and signal to the path (e.g. v1/traces or v1/metrics). The per-signal endpoint configuration options take precedence and can be used to override this behavior. See the [OTLP Specification][otlphttp-req] for more details. https://localhost:4317 OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_TRACES_ENDPOINT OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
Certificate File Path to certificate file for TLS credentials of gRPC client. Should only be used for a secure connection. n/a OTEL_EXPORTER_OTLP_CERTIFICATE OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE
Headers Key-value pairs to be used as headers associated with gRPC or HTTP requests. See Specifying headers for more details. n/a OTEL_EXPORTER_OTLP_HEADERS OTEL_EXPORTER_OTLP_TRACES_HEADERS OTEL_EXPORTER_OTLP_METRICS_HEADERS
Compression Compression key for supported compression types. Supported compression: gzip No value OTEL_EXPORTER_OTLP_COMPRESSION OTEL_EXPORTER_OTLP_TRACES_COMPRESSION OTEL_EXPORTER_OTLP_METRICS_COMPRESSION
Timeout Max waiting time for the backend to process each spans or metrics batch. 10s OTEL_EXPORTER_OTLP_TIMEOUT OTEL_EXPORTER_OTLP_TRACES_TIMEOUT OTEL_EXPORTER_OTLP_METRICS_TIMEOUT

I think this means we can punt on answer this question for now.

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 29, 2021

At least, that is my reading of this section.

@calbot
Copy link

calbot commented Nov 14, 2023

I'm confused...
I would like to be able to configure tracing through the documented environment variables only.
Is that possible?

@pellared
Copy link
Member

@calbot Check the package documentation of the OTLP exporters.

@calbot
Copy link

calbot commented Nov 15, 2023

@calbot Check the package documentation of the OTLP exporters.

Thanks for your response...
It looks like the package go.opentelemetry.io/contrib/exporters/autoexport with autoexport.NewSpanExporter(ctx) gets me closer to what I was looking for. I guess I was looking something along the lines of an "InitTelemetry" function that would read the environment variables and end up calling otel.SetTracerProvider & otel.SetMeterProvider with the right configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:exporter:otlp Related to the OTLP exporter package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants