diff --git a/docs/public/sdk/GettingStarted.rst b/docs/public/sdk/GettingStarted.rst index fcdce5b846..dc982fc391 100644 --- a/docs/public/sdk/GettingStarted.rst +++ b/docs/public/sdk/GettingStarted.rst @@ -66,7 +66,7 @@ OpenTelemetry offers six tracing exporters out of the box: // otlp http exporter opentelemetry::exporter::otlp::OtlpHttpExporterOptions opts; - opts.url = "http://localhost:4317/v1/traces"; + opts.url = "http://localhost:4318/v1/traces"; auto otlp_http_exporter = std::unique_ptr(new opentelemetry::exporter::otlp::OtlpHttpExporter(opts)); diff --git a/examples/otlp/README.md b/examples/otlp/README.md index cd85a392a1..0f6579288e 100644 --- a/examples/otlp/README.md +++ b/examples/otlp/README.md @@ -32,19 +32,18 @@ OpenTelemetry Collector with an OTLP receiver by running: - On Unix based systems use: ```console -docker run --rm -it -p 4317:4317 -p 55681:55681 -v $(pwd)/examples/otlp:/cfg otel/opentelemetry-collector:0.19.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml +docker run --rm -it -p 4317:4317 -p 4318:4318 -v $(pwd)/examples/otlp:/cfg otel/opentelemetry-collector:0.19.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml ``` - On Windows use: ```console -docker run --rm -it -p 4317:4317 -p 55681:55681 -v "%cd%/examples/otlp":/cfg otel/opentelemetry-collector:0.19.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml +docker run --rm -it -p 4317:4317 -p 4318:4318 -v "%cd%/examples/otlp":/cfg otel/opentelemetry-collector:0.19.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml ``` -Note that the OTLP exporter connects to the Collector at `localhost:4317` by -default. This can be changed with first argument from command-line, for example: +Note that the OTLP gRPC and HTTP exporters connects to the Collector at `localhost:4317` and `localhost:4318:/v1/traces` respectively. This can be changed with first argument from command-line, for example: `./example_otlp_grpc gateway.docker.internal:4317` and -`./example_otlp_http gateway.docker.internal:55681/v1/traces`. +`./example_otlp_http gateway.docker.internal:4318/v1/traces`. Once you have the Collector running, see [CONTRIBUTING.md](../../CONTRIBUTING.md) for instructions on building and diff --git a/examples/otlp/opentelemetry-collector-config/config.dev.yaml b/examples/otlp/opentelemetry-collector-config/config.dev.yaml index d3fbfd8834..6eb0b28fcf 100644 --- a/examples/otlp/opentelemetry-collector-config/config.dev.yaml +++ b/examples/otlp/opentelemetry-collector-config/config.dev.yaml @@ -7,7 +7,7 @@ receivers: grpc: endpoint: 0.0.0.0:4317 http: - endpoint: "0.0.0.0:55681" + endpoint: "0.0.0.0:4318" cors_allowed_origins: - '*' service: diff --git a/exporters/otlp/README.md b/exporters/otlp/README.md index e0b1b7f4bb..9ac6918ba7 100644 --- a/exporters/otlp/README.md +++ b/exporters/otlp/README.md @@ -63,7 +63,7 @@ auto exporter = std::unique_ptr(new otlp::OtlpHttpExport | Option | Env Variable |Default | Description | | ------------ |-----|------------ |------| -| `url` | `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://localhost:4317/v1/traces` | The OTLP HTTP endpoint to connect to | +| `url` | `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://localhost:4318/v1/traces` | The OTLP HTTP endpoint to connect to | | | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | | | | `content_type` | n/a | `application/json` | Data format used - JSON or Binary | | `json_bytes_mapping` | n/a | `JsonBytesMappingKind::kHexId` | Encoding used for trace_id and span_id | diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h index c06507daed..4a1882984b 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h @@ -38,7 +38,7 @@ inline const std::string GetOtlpDefaultHttpEndpoint() { constexpr char kOtlpTracesEndpointEnv[] = "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"; constexpr char kOtlpEndpointEnv[] = "OTEL_EXPORTER_OTLP_ENDPOINT"; - constexpr char kOtlpEndpointDefault[] = "http://localhost:4317/v1/traces"; + constexpr char kOtlpEndpointDefault[] = "http://localhost:4318/v1/traces"; auto endpoint = opentelemetry::sdk::common::GetEnvironmentVariable(kOtlpTracesEndpointEnv); if (endpoint.empty())