Skip to content

Commit

Permalink
Update Sample otelcol config (#4397)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: Arianna Laudazzi <[email protected]>
(cherry picked from commit 2ba3a80)
  • Loading branch information
graphaelli authored and mergify[bot] committed Oct 18, 2024
1 parent 6c3bd1d commit 34c489a
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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].
Expand All @@ -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 <<apm-secret-token,secret token authorization>> (`Authorization: "Bearer a_secret_token"`) or <<apm-api-key,API key authorization>> (`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`).
Expand Down

0 comments on commit 34c489a

Please sign in to comment.