OpenTelemetry

Configuration for the integrated OpenTelemetry exporter. A recognizable service_name should be set, and at least one endpoint — either the top-level endpoint or a signal-specific one under metrics, tracing, or logs. All other parameters are optional.

Example:

otel:
  service_name: example
  metrics:
    endpoint: http://prometheus:9090/api/v1/otlp/v1/metrics

service_name

otel:
  service_name: example

Type: String

Default: varnish-supervisor

Service name for metrics identification

endpoint

otel:
  endpoint: http://collector:4318

Type: String

OTLP endpoint URL used for all signals (metrics, traces, and logs) when no signal-specific endpoint is configured. Sets the OTEL_EXPORTER_OTLP_ENDPOINT environment variable.

When using an HTTP protocol (http/protobuf or http/json), the OTLP SDK automatically appends the /v1/<signal> path (for example /v1/metrics), so the endpoint should not include it. A signal-specific endpoint (under metrics, tracing, or logs) takes precedence over this value for that signal.

metrics

Metrics exporter configuration.

enabled

otel:
  metrics:
    enabled: false

Type: Boolean

Default: true

Enable metrics export.

exporter

otel:
  metrics:
    exporter: prometheus

Type: String

Default: otlp

Selects how metrics are exposed.

Options:

  • otlp: Push metrics to an OTLP collector at the configured endpoint.
  • prometheus: Expose Supervisor and Varnish metrics together on a Prometheus scrape endpoint (see prometheus_host and prometheus_port) instead of pushing them to a collector.

endpoint

otel:
  metrics:
    endpoint: http://prometheus:9090/api/v1/otlp/v1/metrics

Type: String

OpenTelemetry endpoint URL for metrics export. Used when exporter is otlp.

When using the http/protobuf protocol, ensure the endpoint path ends with /v1/metrics.

protocol

otel:
  metrics:
    protocol: grpc

Type: String

Default: http/protobuf

Options:

  • http/protobuf
  • grpc
  • http/json

Protocol to use when exporting metrics.

export_interval

otel:
  metrics:
    export_interval: 30

Type: Integer

Default: 60

Metrics export interval in seconds. Applies to the otlp exporter.

scrape_interval

otel:
  metrics:
    scrape_interval: 10

Type: Integer

Default: 10

How often, in seconds, Varnish counters are polled from varnishstat for metrics. This is independent of the OTLP push cadence set by export_interval.

prometheus_host

otel:
  metrics:
    exporter: prometheus
    prometheus_host: 0.0.0.0

Type: String

Default: localhost

Host for the Prometheus scrape endpoint. Only used when exporter is prometheus.

prometheus_port

otel:
  metrics:
    exporter: prometheus
    prometheus_port: 9464

Type: Integer

Default: 9464

Port for the Prometheus /metrics scrape endpoint, which serves both Supervisor and Varnish metrics. Only used when exporter is prometheus.

tracing

Note: Orca Premium feature

A span for a Varnish transaction that failed, with a VSL error or a 5xx response, has the status Error, and an error reported by varnishlog-json is recorded in the error.type and error.message attributes. Other spans leave the status Unset.

enabled

otel:
  tracing:
    enabled: true

Type: Boolean

Default: false

Enable tracing export. Requires the vmod-otel license addon.

endpoint

otel:
  tracing:
    endpoint: http://prometheus:9090/api/v1/otlp/v1/traces

Type: String

OpenTelemetry endpoint URL for trace export.

When using the http/protobuf protocol, ensure the endpoint path ends with /v1/traces.

protocol

otel:
  tracing:
    protocol: grpc

Type: String

Default: http/protobuf

Options:

  • http/protobuf
  • grpc
  • http/json

Protocol to use when exporting traces.

export_interval

otel:
  tracing:
    export_interval: 5

Type: Integer

Default: 5

Tracing batch export interval in seconds.

sampler

otel:
  tracing:
    sampler: parentbased_traceidratio

Type: String

Default: always_on

Trace sampler type. Controls how traces are sampled.

Options:

  • always_on: Sample all traces.
  • always_off: Sample no traces.
  • traceidratio: Sample a fraction of traces based on sampler_arg.
  • parentbased_always_on: Follow parent span’s sampling decision, default to always on.
  • parentbased_always_off: Follow parent span’s sampling decision, default to always off.
  • parentbased_traceidratio: Follow parent span’s sampling decision, default to ratio-based.

sampler_arg

otel:
  tracing:
    sampler: traceidratio
    sampler_arg: 0.1

Type: Number

Default: 1.0

Sampler argument for ratio-based samplers. A value between 0.0 (sample nothing) and 1.0 (sample everything).

logs

Logs exporter configuration.

A Varnish transaction is exported as one log record. The record’s body is the transaction exactly as varnishlog-json printed it, and the values derived from the transaction are set as attributes on the record, so read them from there rather than from the body. The record’s SeverityNumber is ERROR for a transaction that failed with a VSL error or a 5xx response, WARN for a 4xx response, and INFO otherwise. The trace and span IDs are carried in the record’s own trace context fields, not as attributes.

enabled

otel:
  logs:
    enabled: true

Type: Boolean

Default: true (when endpoint is configured)

Enable logs export.

endpoint

otel:
  logs:
    endpoint: http://loki:3100/otlp/v1/logs

Type: String

OTLP endpoint URL for logs export. When empty, logs export is disabled.

When using the http/protobuf protocol, ensure the endpoint path ends with /v1/logs.

protocol

otel:
  logs:
    protocol: grpc

Type: String

Default: http/protobuf

Options:

  • http/protobuf
  • grpc
  • http/json

Protocol to use when exporting logs.

export_interval

otel:
  logs:
    export_interval: 10

Type: Integer

Default: 5

Logs export interval in seconds.


®Varnish Software, Wallingatan 12, 111 60 Stockholm, Organization nr. 556805-6203