Observability
All OTEL_* settings are inert until telemetry is enabled. When it is off, the
OpenTelemetry SDK is not started.
Enable telemetry
Section titled “Enable telemetry”OTEL_ENABLED
Section titled “OTEL_ENABLED”- Type: boolean string
- Default:
false - Use: Master switch for OpenTelemetry.
- Example:
OTEL_ENABLED=true
OTEL_SERVICE_NAME
Section titled “OTEL_SERVICE_NAME”- Type: string
- Default:
discord-mcp - Use: Sets the
service.nameresource attribute. - Example:
OTEL_SERVICE_NAME=discord-mcp-prod
OTEL_SERVICE_VERSION
Section titled “OTEL_SERVICE_VERSION”- Type: string
- Default: the installed package version
- Use: Sets the
service.versionresource attribute for rolling deploys. - Example:
OTEL_SERVICE_VERSION=1.2.3-canary
Export traces
Section titled “Export traces”OTEL_EXPORTER_OTLP_ENDPOINT
Section titled “OTEL_EXPORTER_OTLP_ENDPOINT”- Type: URL
- Default: unset
- Use: OTLP HTTP collector endpoint. The runtime appends
/v1/tracesand/v1/metrics. - Example:
OTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io
OTEL_EXPORTER_OTLP_PROTOCOL
Section titled “OTEL_EXPORTER_OTLP_PROTOCOL”- Type: enum
- Allowed:
http/protobuf,http/json,grpc - Default:
http/protobuf - Runtime status: parsed by configuration but currently ignored. The server
always constructs the HTTP/protobuf trace and metric exporters;
http/jsonandgrpcdo not change transport behavior yet.
OTEL_EXPORTER_OTLP_HEADERS
Section titled “OTEL_EXPORTER_OTLP_HEADERS”- Type: comma-separated
key=valuepairs - Default: unset
- Use: Adds headers to each OTLP export, commonly backend authentication.
- Example:
OTEL_EXPORTER_OTLP_HEADERS=x-honeycomb-team=your-api-key,env=prod
OTEL_CONSOLE_EXPORTER
Section titled “OTEL_CONSOLE_EXPORTER”- Type: boolean string
- Default:
false - Use: Do not enable for a stdio MCP server. The current exporter writes
through
console.dirto stdout, replaces OTLP trace export, and can corrupt JSON-RPC framing. Use an OTLP collector instead. - Safe alternative: configure
OTEL_EXPORTER_OTLP_ENDPOINTand leave thisfalse.
Control sampling
Section titled “Control sampling”OTEL_TRACES_SAMPLER
Section titled “OTEL_TRACES_SAMPLER”- Type: enum
- Allowed:
always_on,always_off,traceidratio,parentbased_always_on,parentbased_always_off,parentbased_traceidratio - Default:
parentbased_always_on - Use: Chooses how traces are sampled.
parentbased_*preserves upstream sampling decisions.
OTEL_TRACES_SAMPLER_ARG
Section titled “OTEL_TRACES_SAMPLER_ARG”- Type: number from 0 to 1
- Default:
1 - Use: Sampling ratio for
traceidratioandparentbased_traceidratio;0.1records 10% of traces. - Example:
OTEL_TRACES_SAMPLER_ARG=0.05