Change otlp http/protobuf default port from 4317 to 4318 (#3694)

This commit is contained in:
jack-berg 2021-10-05 18:24:06 -05:00 committed by GitHub
parent 5556795623
commit 6c3010dd08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 63 additions and 59 deletions

View File

@ -12,6 +12,10 @@ contain generated protobuf classes for the Jaeger API. If you were using these i
you must update your build configuration to also include the new `jaeger-proto` artifact. This
artifact will not be included in a future 2.0 release of the SDK so it is recommended to instead
generated the protobuf classes in your own build.
- BREAKING CHANGE: The `opentelemetry-exporter-otlp-http-*` exporter default endpoint ports have
changed from `4317` to `4318`, in line
with [recent changes](https://github.com/open-telemetry/opentelemetry-specification/pull/1970) to
the spec.
### Auto-configuration (alpha)

View File

@ -23,7 +23,7 @@ import okhttp3.OkHttpClient;
public final class OtlpHttpLogExporterBuilder {
private static final long DEFAULT_TIMEOUT_SECS = 10;
private static final String DEFAULT_ENDPOINT = "http://localhost:4317/v1/logs";
private static final String DEFAULT_ENDPOINT = "http://localhost:4318/v1/logs";
private long timeoutNanos = TimeUnit.SECONDS.toNanos(DEFAULT_TIMEOUT_SECS);
private String endpoint = DEFAULT_ENDPOINT;

View File

@ -23,7 +23,7 @@ import okhttp3.OkHttpClient;
public final class OtlpHttpMetricExporterBuilder {
private static final long DEFAULT_TIMEOUT_SECS = 10;
private static final String DEFAULT_ENDPOINT = "http://localhost:4317/v1/metrics";
private static final String DEFAULT_ENDPOINT = "http://localhost:4318/v1/metrics";
private long timeoutNanos = TimeUnit.SECONDS.toNanos(DEFAULT_TIMEOUT_SECS);
private String endpoint = DEFAULT_ENDPOINT;

View File

@ -108,7 +108,7 @@ class OtlpHttpMetricExporterTest {
assertThatCode(() -> OtlpHttpMetricExporter.builder().setTimeout(Duration.ofMillis(10)))
.doesNotThrowAnyException();
assertThatCode(() -> OtlpHttpMetricExporter.builder().setEndpoint("http://localhost:4317"))
assertThatCode(() -> OtlpHttpMetricExporter.builder().setEndpoint("http://localhost:4318"))
.doesNotThrowAnyException();
assertThatCode(() -> OtlpHttpMetricExporter.builder().setEndpoint("http://localhost"))
.doesNotThrowAnyException();

View File

@ -23,7 +23,7 @@ import okhttp3.OkHttpClient;
public final class OtlpHttpSpanExporterBuilder {
private static final long DEFAULT_TIMEOUT_SECS = 10;
private static final String DEFAULT_ENDPOINT = "http://localhost:4317/v1/traces";
private static final String DEFAULT_ENDPOINT = "http://localhost:4318/v1/traces";
private long timeoutNanos = TimeUnit.SECONDS.toNanos(DEFAULT_TIMEOUT_SECS);
private String endpoint = DEFAULT_ENDPOINT;

View File

@ -109,7 +109,7 @@ class OtlpHttpSpanExporterTest {
assertThatCode(() -> OtlpHttpSpanExporter.builder().setTimeout(Duration.ofMillis(10)))
.doesNotThrowAnyException();
assertThatCode(() -> OtlpHttpSpanExporter.builder().setEndpoint("http://localhost:4317"))
assertThatCode(() -> OtlpHttpSpanExporter.builder().setEndpoint("http://localhost:4318"))
.doesNotThrowAnyException();
assertThatCode(() -> OtlpHttpSpanExporter.builder().setEndpoint("http://localhost"))
.doesNotThrowAnyException();

View File

@ -50,9 +50,9 @@ The [OpenTelemetry Protocol (OTLP)](https://github.com/open-telemetry/openteleme
|------------------------------|-----------------------------|---------------------------------------------------------------------------|
| otel.traces.exporter=otlp (default) | OTEL_TRACES_EXPORTER=otlp | Select the OpenTelemetry exporter for tracing (default) |
| otel.metrics.exporter=otlp | OTEL_METRICS_EXPORTER=otlp | Select the OpenTelemetry exporter for metrics |
| otel.exporter.otlp.endpoint | OTEL_EXPORTER_OTLP_ENDPOINT | The OTLP traces and metrics endpoint to connect to. Must be a URL with a scheme of either `http` or `https` based on the use of TLS. If protocol is `http/protobuf` the version and signal will be appended to the path (e.g. `v1/traces` or `v1/metrics`). Default is `http://localhost:4317` when protocol is `grpc`, and `http://localhost:4317/v1/{signal}` when protocol is `http/protobuf`. |
| otel.exporter.otlp.traces.endpoint | OTEL_EXPORTER_OTLP_TRACES_ENDPOINT | The OTLP traces endpoint to connect to. Must be a URL with a scheme of either `http` or `https` based on the use of TLS. Default is `http://localhost:4317` when protocol is `grpc`, and `http://localhost:4317/v1/traces` when protocol is `http/protobuf`. |
| otel.exporter.otlp.metrics.endpoint | OTEL_EXPORTER_OTLP_METRICS_ENDPOINT | The OTLP metrics endpoint to connect to. Must be a URL with a scheme of either `http` or `https` based on the use of TLS. Default is `http://localhost:4317` when protocol is `grpc`, and `http://localhost:4317/v1/metrics` when protocol is `http/protobuf`. |
| otel.exporter.otlp.endpoint | OTEL_EXPORTER_OTLP_ENDPOINT | The OTLP traces and metrics endpoint to connect to. Must be a URL with a scheme of either `http` or `https` based on the use of TLS. If protocol is `http/protobuf` the version and signal will be appended to the path (e.g. `v1/traces` or `v1/metrics`). Default is `http://localhost:4317` when protocol is `grpc`, and `http://localhost:4318/v1/{signal}` when protocol is `http/protobuf`. |
| otel.exporter.otlp.traces.endpoint | OTEL_EXPORTER_OTLP_TRACES_ENDPOINT | The OTLP traces endpoint to connect to. Must be a URL with a scheme of either `http` or `https` based on the use of TLS. Default is `http://localhost:4317` when protocol is `grpc`, and `http://localhost:4318/v1/traces` when protocol is `http/protobuf`. |
| otel.exporter.otlp.metrics.endpoint | OTEL_EXPORTER_OTLP_METRICS_ENDPOINT | The OTLP metrics endpoint to connect to. Must be a URL with a scheme of either `http` or `https` based on the use of TLS. Default is `http://localhost:4317` when protocol is `grpc`, and `http://localhost:4318/v1/metrics` when protocol is `http/protobuf`. |
| otel.exporter.otlp.certificate | OTEL_EXPORTER_OTLP_CERTIFICATE | The path to the file containing trusted certificates to use when verifying an OTLP trace or metric server's TLS credentials. The file should contain one or more X.509 certificates in PEM format. By default the host platform's trusted root certificates are used. |
| otel.exporter.otlp.traces.certificate | OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE | The path to the file containing trusted certificates to use when verifying an OTLP trace server's TLS credentials. The file should contain one or more X.509 certificates in PEM format. By default the host platform's trusted root certificates are used. |
| otel.exporter.otlp.metrics.certificate | OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE | The path to the file containing trusted certificates to use when verifying an OTLP metric server's TLS credentials. The file should contain one or more X.509 certificates in PEM format. By default the host platform's trusted root certificates are used. |

View File

@ -96,7 +96,7 @@ class OtlpConfigUtilTest {
configureEndpointCallable(
ImmutableMap.of(
GENERIC_ENDPOINT_KEY,
"http://localhost:4317/path",
"http://localhost:4318/path",
"otel.exporter.otlp.protocol",
"http/protobuf")))
.doesNotThrowAnyException();
@ -141,77 +141,77 @@ class OtlpConfigUtilTest {
void configureOtlpExporterBuilder_HttpGenericEndpointKey() {
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4317"))
.isEqualTo("http://localhost:4317/v1/traces");
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4318"))
.isEqualTo("http://localhost:4318/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4317/"))
.isEqualTo("http://localhost:4317/v1/traces");
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4318/"))
.isEqualTo("http://localhost:4318/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4317/foo"))
.isEqualTo("http://localhost:4317/foo/v1/traces");
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4318/foo"))
.isEqualTo("http://localhost:4318/foo/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4317/foo/"))
.isEqualTo("http://localhost:4317/foo/v1/traces");
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4318/foo/"))
.isEqualTo("http://localhost:4318/foo/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4317/v1/traces"))
.isEqualTo("http://localhost:4317/v1/traces/v1/traces");
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4318/v1/traces"))
.isEqualTo("http://localhost:4318/v1/traces/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4317/v1/metrics"))
.isEqualTo("http://localhost:4317/v1/metrics/v1/traces");
DATA_TYPE_TRACES, GENERIC_ENDPOINT_KEY, "http://localhost:4318/v1/metrics"))
.isEqualTo("http://localhost:4318/v1/metrics/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4317"))
.isEqualTo("http://localhost:4317/v1/metrics");
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4318"))
.isEqualTo("http://localhost:4318/v1/metrics");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4317/"))
.isEqualTo("http://localhost:4317/v1/metrics");
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4318/"))
.isEqualTo("http://localhost:4318/v1/metrics");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4317/foo"))
.isEqualTo("http://localhost:4317/foo/v1/metrics");
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4318/foo"))
.isEqualTo("http://localhost:4318/foo/v1/metrics");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4317/foo/"))
.isEqualTo("http://localhost:4317/foo/v1/metrics");
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4318/foo/"))
.isEqualTo("http://localhost:4318/foo/v1/metrics");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4317/v1/metrics"))
.isEqualTo("http://localhost:4317/v1/metrics/v1/metrics");
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4318/v1/metrics"))
.isEqualTo("http://localhost:4318/v1/metrics/v1/metrics");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4317/v1/traces"))
.isEqualTo("http://localhost:4317/v1/traces/v1/metrics");
DATA_TYPE_METRICS, GENERIC_ENDPOINT_KEY, "http://localhost:4318/v1/traces"))
.isEqualTo("http://localhost:4318/v1/traces/v1/metrics");
}
@Test
void configureOtlpExporterBuilder_HttpTracesEndpointKey() {
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4317"))
.isEqualTo("http://localhost:4317/");
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4318"))
.isEqualTo("http://localhost:4318/");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4317"))
.isEqualTo("http://localhost:4317/");
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4318"))
.isEqualTo("http://localhost:4318/");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4317/"))
.isEqualTo("http://localhost:4317/");
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4318/"))
.isEqualTo("http://localhost:4318/");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4317/v1/traces"))
.isEqualTo("http://localhost:4317/v1/traces");
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4318/v1/traces"))
.isEqualTo("http://localhost:4318/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4317/foo/bar"))
.isEqualTo("http://localhost:4317/foo/bar");
DATA_TYPE_TRACES, TRACES_ENDPOINT_KEY, "http://localhost:4318/foo/bar"))
.isEqualTo("http://localhost:4318/foo/bar");
assertThat(
configureEndpoint(
DATA_TYPE_TRACES,
@ -219,34 +219,34 @@ class OtlpConfigUtilTest {
"otel.exporter.otlp.protocol",
PROTOCOL_HTTP_PROTOBUF,
GENERIC_ENDPOINT_KEY,
"http://localhost:4317/foo/bar",
"http://localhost:4318/foo/bar",
TRACES_ENDPOINT_KEY,
"http://localhost:4317/baz/qux")))
.isEqualTo("http://localhost:4317/baz/qux");
"http://localhost:4318/baz/qux")))
.isEqualTo("http://localhost:4318/baz/qux");
}
@Test
void configureOtlpExporterBuilder_HttpMetricsEndpointKey() {
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4317"))
.isEqualTo("http://localhost:4317/");
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4318"))
.isEqualTo("http://localhost:4318/");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4317"))
.isEqualTo("http://localhost:4317/");
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4318"))
.isEqualTo("http://localhost:4318/");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4317/"))
.isEqualTo("http://localhost:4317/");
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4318/"))
.isEqualTo("http://localhost:4318/");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4317/v1/traces"))
.isEqualTo("http://localhost:4317/v1/traces");
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4318/v1/traces"))
.isEqualTo("http://localhost:4318/v1/traces");
assertThat(
configureEndpointForHttp(
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4317/foo/bar"))
.isEqualTo("http://localhost:4317/foo/bar");
DATA_TYPE_METRICS, METRICS_ENDPOINT_KEY, "http://localhost:4318/foo/bar"))
.isEqualTo("http://localhost:4318/foo/bar");
assertThat(
configureEndpoint(
DATA_TYPE_METRICS,
@ -254,10 +254,10 @@ class OtlpConfigUtilTest {
"otel.exporter.otlp.protocol",
PROTOCOL_HTTP_PROTOBUF,
GENERIC_ENDPOINT_KEY,
"http://localhost:4317/foo/bar",
"http://localhost:4318/foo/bar",
METRICS_ENDPOINT_KEY,
"http://localhost:4317/baz/qux")))
.isEqualTo("http://localhost:4317/baz/qux");
"http://localhost:4318/baz/qux")))
.isEqualTo("http://localhost:4318/baz/qux");
}
private static String configureEndpointForHttp(