Skip to content

Commit

Permalink
Clarify OTLP/HTTP port handling. (#1985)
Browse files Browse the repository at this point in the history
Clarifies that default ports for the URL schemes, not default OTLP/HTTP port should be used if no port is given in URL.

See open-telemetry/opentelemetry-specification#1975 (comment)
  • Loading branch information
Oberon00 authored Oct 12, 2021
1 parent d6e8971 commit 0dcc3fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ release.

### OpenTelemetry Protocol

- Specify the behavior of the OTLP endpoint variables for OTLP/HTTP more strictly
([#1975](https://github.com/open-telemetry/opentelemetry-specification/pull/1975),
[#1985](https://github.com/open-telemetry/opentelemetry-specification/pull/1985))
- Make OTLP/HTTP the recommended default transport ([#1969](https://github.com/open-telemetry/opentelemetry-specification/pull/1969))

### SDK Configuration
Expand Down Expand Up @@ -105,8 +108,6 @@ release.
### OpenTelemetry Protocol

- Add environment variables for configuring the OTLP exporter protocol (`grpc`, `http/protobuf`, `http/json`) ([#1880](https://github.com/open-telemetry/opentelemetry-specification/pull/1880))
- Specify the behavior of the OTLP endpoint variables for OTLP/HTTP more strictly
([#1975](https://github.com/open-telemetry/opentelemetry-specification/pull/1975)).
- Allow implementations to use their own default for OTLP compression, with `none` denotating no compression
([#1923](https://github.com/open-telemetry/opentelemetry-specification/pull/1923))
- Clarify OTLP server components MUST support none/gzip compression
Expand Down
14 changes: 10 additions & 4 deletions specification/protocol/exporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ for each signal as follow:
Non-normatively, this could be implemented by ensuring that the base URL ends with
a slash and then appending the relative URLs as strings.

An SDK MUST NOT modify the URL in ways other than specified above. That also means,
if the port is empty or not given, TCP port 80 is the default for the `http` scheme
and TCP port 443 is the default for the `https` scheme, as per the usual rules
for these schemes ([RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-2.7.1)).

#### Example 1

The following configuration sends all signals to the same collector:
Expand All @@ -74,7 +79,7 @@ export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://collector.example.com/v1/metr
This will send traces directly to the root path `http://collector:4318/`
(`/v1/traces` is only automatically added when using the non-signal-specific
environment variable) and metrics
to `https://collector.example.com/v1/metrics`.
to `https://collector.example.com/v1/metrics`, using the default https port (443).

#### Example 3

Expand All @@ -86,9 +91,10 @@ export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://collector.example.com/v1/metr
```

Traces are sent to `http://collector:4318/mycollector/v1/traces`
and metrics to `https://collector.example.com/v1/metrics/`
(other signals, would they be defined, would be sent to their specific paths
relative to `http://collector:4318/mycollector/`).
and metrics to `https://collector.example.com/v1/metrics/`, using the default
https port (443).
Other signals, (if there were any) would be sent to their specific paths
relative to `http://collector:4318/mycollector/`.

### Specify Protocol

Expand Down

0 comments on commit 0dcc3fb

Please sign in to comment.