OpenTelemetry Protocol (OTLP) exporter
Configure the OpenTelemetry Protocol (OTLP) exporter for metrics
Enable and configure the OpenTelemetry Protocol (OTLP) exporter for metrics in the GraphOS Router or Apollo Router Core.
For general metrics configuration, refer to Router Metrics Configuration.
Using the OTLP protocol, you can export metrics to any OTLP compatible receiver, including:
OTLP configuration
The router can be configured to export metrics data using OTLP over either HTTP or gRPC.
An example router configuration using OTLP with gRPC:
1telemetry:
2 exporters:
3 metrics:
4 otlp:
5 # Enable the OpenTelemetry exporter
6 enabled: true
7
8 # Optional endpoint, either 'default' or a URL (Defaults to http://127.0.0.1:4317 for gRPC and http://127.0.0.1:4318 for HTTP)
9 endpoint: default
10
11 # Optional protocol
12 protocol: grpc
13
14 # Optional gRPC configuration
15 grpc:
16 metadata:
17 foo: bar
18
19 # Optional batch_processor configuration
20 batch_processor:
21 scheduled_delay: 100ms
22 max_concurrent_exports: 1000
23 max_export_batch_size: 10000
24 max_export_timeout: 100s
25 max_queue_size: 10000
enabled
Flag to enable the OTLP exporter.
Set to true to enable the OTLP exporter. Defaults to false.
endpoint
The OTLP endpoint address.
Defaults to:
http://127.0.0.1:4317 for gRPC
http://127.0.0.1:4318 for HTTP
grpc
Settings specific to the gRPC protocol for setting a custom SSL certificate, domain name, and metadata.
1telemetry:
2 exporters:
3 tracing:
4 otlp:
5 grpc:
6 domain_name: "<my-domain>"
7 key: "<key>"
8 ca: "<certificate-authority>"
9 cert: "<certificate>"
10 metadata:
11 key1: value1
12 key2: value2
env.
and file.
prefixes, for example ${file.ca.txt}
.See gRPC Authentication for more information.
gRPC configuration reference
Attribute | Description |
---|---|
domain_name | An optional domain name |
key | An optional key |
ca | An optional certificate authority |
cert | An optional certificate |
metadata | A map of headers to send with requests |
http
Settings specific to the HTTP protocol for setting custom headers.
1http:
2 headers:
3 key1: value1
4 key2: value2
HTTP configuration reference
Attribute | Description |
---|---|
headers | A map of headers to send with requests |
batch_processor
All exporters support configuration of a batch span processor with batch_processor
.
You must tune your batch_processor
configuration if you see any of the following messages in your logs:
OpenTelemetry trace error occurred: cannot send span to the batch span processor because the channel is full
OpenTelemetry metrics error occurred: cannot send span to the batch span processor because the channel is full
The exact settings depend on the bandwidth available for you to send data to your application peformance monitor (APM) and the bandwidth configuration of your APM. Expect to tune these settings over time as your application changes.
An example configuration using OTLP with batch_processor
:
1telemetry:
2 exporters:
3 metrics:
4 otlp:
5 batch_processor:
6 max_export_batch_size: 512
7 max_concurrent_exports: 1
8 max_export_timeout: 30s
9 max_queue_size: 2048
10 scheduled_delay: 5s
batch_processor
configuration reference
Attribute | Default | Description |
---|---|---|
scheduled_delay | 5s | The delay in seconds from receiving the first span to sending the batch. |
max_concurrent_exports | 1 | The maximum number of overlapping export requests. |
max_export_batch_size | 512 | The number of spans to include in a batch. May be limited by maximum message size limits. |
max_export_timeout | 30s | The timeout in seconds for sending spans before dropping the data. |
max_queue_size | 2048 | The maximum number of spans to be buffered before dropping span data. |
OTLP configuration reference
Attribute | Values | Default | Description |
---|---|---|---|
enabled | false | Enable the OTLP exporter. | |
protocol | grpc |http | grpc | The protocol to use. |
endpoint | http://127.0.0.1:4317 for gRPC and http://127.0.0.1:4318 for HTTP | The endpoint to send spans to. | |
grpc | Configuration specific to gRPC protocol. | ||
http | Configuration specific to HTTP protocol. | ||
temporality | delta |cumulative | See the documentation for your APM to see what this should be set to. |