Skip to content

Commit 009964c

Browse files
mergify[bot]axw
andauthored
Modernise OpenTelemetry Collector example config (#3518) (#3525)
* Use OpenTelemetry Collector `debug` exporter The `logging` exporter is deprecated, and its recommended replacement is the `debug` exporter. * Use upstream-documented env var expansion syntax See https://opentelemetry.io/docs/collector/configuration/#environment-variables * Update docs link * More fixes Noticed a couple of unrelated issues while previewing changes: - broken links to OTLP and Elasticsearch exporters - unnecessary parentheses around OTLP/gRPC and OTLP/HTTP (cherry picked from commit 1debccc) Co-authored-by: Andrew Wilkins <[email protected]>
1 parent 9f71126 commit 009964c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docs/en/observability/apm/otel-direct.asciidoc

+12-12
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@ processors: <2>
3232
batch:
3333
3434
exporters:
35-
logging:
36-
loglevel: warn <3>
35+
debug:
36+
verbosity: detailed <3>
3737
otlp/elastic: <4>
3838
# Elastic APM server https endpoint without the "https://" prefix
39-
endpoint: "${ELASTIC_APM_SERVER_ENDPOINT}" <5> <7>
39+
endpoint: "${env:ELASTIC_APM_SERVER_ENDPOINT}" <5> <7>
4040
headers:
4141
# Elastic APM Server secret token
42-
Authorization: "Bearer ${ELASTIC_APM_SECRET_TOKEN}" <6> <7>
42+
Authorization: "Bearer ${env:ELASTIC_APM_SECRET_TOKEN}" <6> <7>
4343
4444
service:
4545
pipelines:
4646
traces:
4747
receivers: [otlp]
48-
exporters: [logging, otlp/elastic]
48+
exporters: [debug, otlp/elastic]
4949
metrics:
5050
receivers: [otlp]
51-
exporters: [logging, otlp/elastic]
51+
exporters: [debug, otlp/elastic]
5252
logs: <8>
5353
receivers: [otlp]
54-
exporters: [logging, otlp/elastic]
54+
exporters: [debug, otlp/elastic]
5555
----
5656
<1> The receivers, like the
5757
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].
5858
<2> We recommend using the https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md[Batch processor] and the https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiterprocessor/README.md[memory limiter processor]. For more information, see https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/README.md#recommended-processors[recommended processors].
59-
<3> The https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/loggingexporter[logging exporter] is helpful for troubleshooting and supports various logging levels, like `debug`, `info`, `warn`, and `error`.
59+
<3> The https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter[debug exporter] is helpful for troubleshooting, and supports configurable verbosity levels: `basic` (default), `normal`, and `detailed`.
6060
<4> Elastic {observability} endpoint configuration.
6161
APM Server supports a ProtoBuf payload via both the OTLP protocol over gRPC transport {ot-grpc}[(OTLP/gRPC)]
6262
and the OTLP protocol over HTTP transport {ot-http}[(OTLP/HTTP)].
@@ -65,13 +65,13 @@ https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otl
6565
https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter[OTLP/gRPC exporter].
6666
<5> Hostname and port of the APM Server endpoint. For example, `elastic-apm-server:8200`.
6767
<6> Credential for Elastic APM <<secret-token,secret token authorization>> (`Authorization: "Bearer a_secret_token"`) or <<api-key,API key authorization>> (`Authorization: "ApiKey an_api_key"`).
68-
<7> Environment-specific configuration parameters can be conveniently passed in as environment variables documented https://opentelemetry.io/docs/collector/configuration/#configuration-environment-variables[here] (e.g. `ELASTIC_APM_SERVER_ENDPOINT` and `ELASTIC_APM_SECRET_TOKEN`).
68+
<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`).
6969
<8> preview:[] To send OpenTelemetry logs to {stack} version 8.0+, declare a `logs` pipeline.
7070

7171
You're now ready to export traces and metrics from your services and applications.
7272

73-
TIP: When using the OpenTelemetry collector, you should always prefer sending data via the [`OTLP` exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter) to an Elastic APM Server.
74-
Other methods, like using the [`elasticsearch` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/elasticsearchexporter) to send data directly to {es} will send data to the {stack},
73+
TIP: When using the OpenTelemetry collector, you should always prefer sending data via the https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter[`OTLP` exporter] to an Elastic APM Server.
74+
Other methods, like using the https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/elasticsearchexporter[`elasticsearch` exporter] to send data directly to {es} will send data to the {stack},
7575
but will bypass all of the validation and data processing that the APM Server performs.
7676
In addition, your data will not be viewable in the {kib} {observability} apps if you use the `elasticsearch` exporter.
7777

@@ -128,7 +128,7 @@ and <<open-telemetry-visualize,visualizing metrics>> in {kib}.
128128
[[open-telemetry-proxy-apm]]
129129
==== Proxy requests to APM Server
130130

131-
APM Server supports both the {ot-grpc}[(OTLP/gRPC)] and {ot-http}[(OTLP/HTTP)] protocol on the same port as Elastic APM agent requests. For ease of setup, we recommend using OTLP/HTTP when proxying or load balancing requests to the APM Server.
131+
APM Server supports both the {ot-grpc}[OTLP/gRPC] and {ot-http}[OTLP/HTTP] protocol on the same port as Elastic APM agent requests. For ease of setup, we recommend using OTLP/HTTP when proxying or load balancing requests to the APM Server.
132132

133133
If you use the OTLP/gRPC protocol, requests to the APM Server must use either HTTP/2 over TLS or HTTP/2 Cleartext (H2C). No matter which protocol is used, OTLP/gRPC requests will have the header: `"Content-Type: application/grpc"`.
134134

0 commit comments

Comments
 (0)