From 1acec9a688b047d5bc30c06f2fb497c648f7ee79 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:40:33 +0000 Subject: [PATCH] Update Sample otelcol config (#4397) (#4399) * update to valid otlp receiver config With recent versions of OpenTelemetry Collector it is necessary to specify protocols * simplify exporter configuration and note advanced option * fix link syntax * Update docs/en/observability/apm/collect-application-data/open-telemetry/otel-direct.asciidoc Co-authored-by: Arianna Laudazzi <46651782+alaudazzi@users.noreply.github.com> --------- Co-authored-by: Arianna Laudazzi <46651782+alaudazzi@users.noreply.github.com> (cherry picked from commit 2ba3a8045894577a2cd35d930eed19575ef3aa8c) Co-authored-by: Gil Raphaelli --- .../open-telemetry/otel-direct.asciidoc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/en/observability/apm/collect-application-data/open-telemetry/otel-direct.asciidoc b/docs/en/observability/apm/collect-application-data/open-telemetry/otel-direct.asciidoc index 9761a73dbf..77b8ad3b72 100644 --- a/docs/en/observability/apm/collect-application-data/open-telemetry/otel-direct.asciidoc +++ b/docs/en/observability/apm/collect-application-data/open-telemetry/otel-direct.asciidoc @@ -26,7 +26,11 @@ Connect your OpenTelemetry Collector instances to Elastic {observability} using receivers: <1> # ... otlp: - + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 processors: <2> # ... memory_limiter: @@ -37,7 +41,7 @@ processors: <2> exporters: debug: verbosity: detailed <3> - otlp/elastic: <4> + otlp: <4> # Elastic APM server https endpoint without the "https://" prefix endpoint: "${env:ELASTIC_APM_SERVER_ENDPOINT}" <5> <7> headers: @@ -49,15 +53,15 @@ service: traces: receivers: [otlp] processors: [..., memory_limiter, batch] - exporters: [debug, otlp/elastic] + exporters: [debug, otlp] metrics: receivers: [otlp] processors: [..., memory_limiter, batch] - exporters: [debug, otlp/elastic] + exporters: [debug, otlp] logs: <8> receivers: [otlp] processors: [..., memory_limiter, batch] - exporters: [debug, otlp/elastic] + exporters: [debug, otlp] ---- <1> The receivers, like the https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver[OTLP receiver], that forward data emitted by APM agents, or the https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver[host metrics receiver]. @@ -69,6 +73,7 @@ and the OTLP protocol over HTTP transport https://opentelemetry.io/docs/specs/ot To learn more about these exporters, see the OpenTelemetry Collector documentation: https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter[OTLP/HTTP Exporter] or https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter[OTLP/gRPC exporter]. +When adding an endpoint to an existing configuration an optional name component can be added, like `otlp/elastic`, to distinguish endpoints as described in the https://opentelemetry.io/docs/collector/configuration/#basics[OpenTelemetry Collector Configuration Basics]. <5> Hostname and port of the APM Server endpoint. For example, `elastic-apm-server:8200`. <6> Credential for Elastic APM <> (`Authorization: "Bearer a_secret_token"`) or <> (`Authorization: "ApiKey an_api_key"`). <7> Environment-specific configuration parameters can be conveniently passed in as environment variables documented https://opentelemetry.io/docs/collector/configuration/#environment-variables[here] (e.g. `ELASTIC_APM_SERVER_ENDPOINT` and `ELASTIC_APM_SECRET_TOKEN`).