src/platform/packages/shared/kbn-telemetry/README.md
Contains initialization functions and utilities for Telemetry (as in, OpenTelemetry).
The following config is the recommended minimum piece of config for instrumenting OpenTelemetry traces, metrics and logs:
# For server logs
logging.appenders.otel:
type: otel
protocol: proto
url: <URL_TO_THE_OTLP_ENDPOINT>/v1/logs
headers:
authorization: "ApiKey [REDACTED]"
logging.root.appenders: [ default, otel ] # "default" keeps logging to console. Remove if not wanted.
# For server metrics
telemetry.metrics:
enabled: true
interval: 10s
exporters:
- proto:
url: <URL_TO_THE_OTLP_ENDPOINT>/v1/metrics
headers:
authorization: "ApiKey [REDACTED]"
# For server traces
telemetry.tracing:
enabled: true
sample_rate: 1 # 100% of the traces
exporters:
- proto:
url: <URL_TO_THE_OTLP_ENDPOINT>/v1/traces
headers:
authorization: 'ApiKey [REDACTED]'
# For RUM traces (pending to be migrated to OTel when OTel RUM is production-ready)
elastic.apm:
serverUrl: <URL_TO_THE_APM_SERVER>
# Below are optional
environment: localhost
transactionSampleRate: 1 # 100% of the traces in RUM
[!TIP] The best way to get started is by using an ECH deployment. It offers a Managed OTLP endpoint (mOTLP) that you can use to ship your OTel Traces, Metrics and Logs without the hassle of starting one locally. The same applies to the APM Server. To retrieve the
<URL_TO_THE_OTLP_ENDPOINT>and theApiKey, in the Kibana of your ECH deployment, head toObservability>Add data(top-right corner) >Application>OpenTelemetry. The URL and credentials will be shown in the sectionConfigure the OpenTelemetry SDK.
@kbn/metrics docs.@kbn/tracing docs.