Tracing
Gate supports distributed tracing via the OpenTelemetry OTLP exporter. Traces can be exported to any OTLP-compatible backend (Jaeger, Grafana Tempo, Honeycomb, etc.).
Service name
The service_name field sets the service name attached to all traces and log records. It is a top-level field under gate::
- Environment variables
- HCL
- JSON
- TOML
- YAML
GATE_SERVICE_NAME=my-gate
gate = {
service_name = "my-gate"
}
{
"gate": {
"service_name": "my-gate"
}
}
[gate]
service_name = "my-gate"
gate:
service_name: my-gate
OpenTelemetry exporter
Use tracing.exporter.opentelemetry to export traces to an OTLP endpoint:
- Environment variables
- HCL
- JSON
- TOML
- YAML
GATE_SERVICE_NAME=my-gate
GATE_TRACING_EXPORTER_OPENTELEMETRY_ENABLED=true
GATE_TRACING_EXPORTER_OPENTELEMETRY_ENDPOINT=http://otel-collector:4317
GATE_TRACING_EXPORTER_OPENTELEMETRY_PROTOCOL=grpc
GATE_TRACING_EXPORTER_OPENTELEMETRY_HEADERS_<HEADER_NAME>=<Header value>
GATE_TRACING_SAMPLE_PROBABILITY=1.0
gate = {
service_name = "my-gate"
tracing = {
exporter = {
opentelemetry = {
enabled = true
endpoint = "http://otel-collector:4317"
protocol = "grpc"
headers = {
"<Header name>" = "<Header value>"
}
}
}
sample = {
probability = "1.0"
}
}
}
{
"gate": {
"service_name": "my-gate",
"tracing": {
"exporter": {
"opentelemetry": {
"enabled": true,
"endpoint": "http://otel-collector:4317",
"protocol": "grpc",
"headers": {
"<Header name>": "<Header value>"
}
}
},
"sample": {
"probability": "1.0"
}
}
}
}
[gate]
service_name = "my-gate"
[gate.tracing]
[gate.tracing.exporter]
[gate.tracing.exporter.opentelemetry]
enabled = true
endpoint = "http://otel-collector:4317"
protocol = "grpc"
[gate.tracing.exporter.opentelemetry.headers]
"<Header name>" = "<Header value>"
[gate.tracing.sample]
probability = "1.0"
gate:
service_name: my-gate
tracing:
exporter:
opentelemetry:
enabled: true
endpoint: http://otel-collector:4317
protocol: grpc
headers:
<Header name>: <Header value>
sample:
probability: "1.0"
Parameters
| Parameter | Description | Default |
|---|---|---|
enabled | Enable the exporter | false |
endpoint | OTLP collector endpoint URL | — |
protocol | Transport protocol: grpc (port 4317) or http (port 4318) | grpc |
headers | Additional headers to send with each export request (key/value map) | — |
Sampling
The tracing.sample.probability field controls the fraction of requests that are traced (0.0–1.0). The default is 1.0 (100%).
Sending traces to Jaeger
danger
The tracing.exporter.jaeger configuration (Jaeger Thrift protocol) is deprecated. Use tracing.exporter.opentelemetry instead — Jaeger 1.35+ accepts OTLP directly.
Point Gate at Jaeger's OTLP gRPC port (4317):
gate:
service_name: my-gate
tracing:
exporter:
opentelemetry:
enabled: true
endpoint: http://jaeger:4317
protocol: grpc