You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify OTEL_EXPORTER_OTLP_ENDPOINT envvar for OTLP/HTTP. (open-telemetry#1975)
The current wording of the OTLP endpoint config was confusing, especially the "if not present already" wording. Instead, clarify that we must always append when using the envvar for all signals (it was already clearly specified that the per-signal vars do not get the path appended).
This came up in open-telemetry/opentelemetry-java#3650 and again at open-telemetry/opentelemetry-java#3666 (comment).
Also make it a MUST (not SHOULD) since this kind of thing would be extremely annoying to have differences per-language in. Also, without appending, the variable cannot be used to configure more than one signal which would defeat its sole purpose.
| Endpoint (OTLP/HTTP) | 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`, exporters SHOULD follow the collector convention of appending the version and signal to the path (e.g. `v1/traces` or `v1/metrics`), if not present already. 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:4318`|`OTEL_EXPORTER_OTLP_ENDPOINT``OTEL_EXPORTER_OTLP_TRACES_ENDPOINT``OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`|
13
+
| Endpoint (OTLP/HTTP) | Target URL 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, MAY contain a port, SHOULD contain a path and MUST NOT contain other parts (such as query string or fragment). A scheme of https indicates a secure connection. When using `OTEL_EXPORTER_OTLP_ENDPOINT`, exporters MUST construct per-signal URLs as [described below](#per-signal-urls). The per-signal endpoint configuration options take precedence and can be used to override this behavior (the URL is used as-is for them, without any modifications). See the [OTLP Specification][otlphttp-req] for more details. |`https://localhost:4318`|`OTEL_EXPORTER_OTLP_ENDPOINT``OTEL_EXPORTER_OTLP_TRACES_ENDPOINT``OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`|
14
14
| Endpoint (OTLP/gRPC) | Target to which the exporter is going to send spans or metrics. The endpoint SHOULD accept any form allowed by the underlying gRPC client implementation. Additionally, the endpoint MUST accept a URL with a scheme of either `http` or `https`. A scheme of `https` indicates a secure connection and takes precedence over the `insecure` configuration setting. If the gRPC client implementation does not support an endpoint with a scheme of `http` or `https` then the endpoint SHOULD be transformed to the most sensible format for that implementation. |`https://localhost:4317`|`OTEL_EXPORTER_OTLP_ENDPOINT``OTEL_EXPORTER_OTLP_TRACES_ENDPOINT``OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`|
15
15
| Insecure | Whether to enable client transport security for the exporter's gRPC connection. This option only applies to OTLP/gRPC - OTLP/HTTP always uses the scheme provided for the `endpoint`. Implementations MAY choose to not implement the `insecure` option if it is not required or supported by the underlying gRPC client implementation. |`false`|`OTEL_EXPORTER_OTLP_INSECURE``OTEL_EXPORTER_OTLP_SPAN_INSECURE``OTEL_EXPORTER_OTLP_METRIC_INSECURE`|
16
16
| Certificate File | The trusted certificate to use when verifying a server's TLS credentials. Should only be used for a secure connection. | n/a |`OTEL_EXPORTER_OTLP_CERTIFICATE``OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE``OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE`|
@@ -28,24 +28,65 @@ Supported values for `OTEL_EXPORTER_OTLP_*COMPRESSION` options:
28
28
-`none` if compression is disabled.
29
29
-`gzip` is the only specified compression method for now.
30
30
31
-
Example 1
31
+
<aname="per-signal-urls"></a>
32
+
33
+
### Endpoint URLs for OTLP/HTTP
34
+
35
+
Based on the environment variables above, the OTLP/HTTP exporter MUST construct URLs
36
+
for each signal as follow:
37
+
38
+
1. For the per-signal variables (`OTEL_EXPORTER_OTLP_<signal>_ENDPOINT`), the URL
39
+
MUST be used as-is without any modification. The only exception is that if an
40
+
URL contains no path part, the root path `/` MUST be used (see [Example 2](#example-2)).
41
+
2. If signals are sent that have no per-signal configuration from the previous point,
42
+
`OTEL_EXPORTER_OTLP_ENDPOINT` is used as a base URL and the signals are sent
43
+
to these paths relative to that:
44
+
45
+
* Traces: `v1/traces`
46
+
* Metrics: `v1/metrics`.
47
+
48
+
Non-normatively, this could be implemented by ensuring that the base URL ends with
49
+
a slash and then appending the relative URLs as strings.
50
+
51
+
#### Example 1
32
52
33
53
The following configuration sends all signals to the same collector:
Traces are sent to `http://collector:4318/mycollector/v1/traces`
86
+
and metrics to `https://collector.example.com/v1/metrics/`
87
+
(other signals, would they be defined, would be sent to their specific paths
88
+
relative to `http://collector:4318/mycollector/`).
89
+
49
90
### Specify Protocol
50
91
51
92
The `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`, and `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` environment variables specify the OTLP transport protocol. Supported values:
0 commit comments