varnish-otel
is intended to provide comprehensive observability for Varnish Cache environments. By leveraging OpenTelemetry to export logs, metrics and traces, varnish-otel
will offer detailed insights into caching behavior, traffic flows, and system performance.
Important: varnish-otel
is currently in beta and is not available through the main Varnish Enterprise repositories. Please contact your account manager or sales@varnish-software.com to get access to it.
Before anything else, make sure Varnish is already up and running. You can refer to our installation tutorials for detailed instructions.
You can also use the automated installation method for a quicker approach.
To enable tracing, include the otel.vcl
at the top of you main VCL file:
vcl 4.1
include "otel.vcl";
...
varnish-otel
package can be found in the experimental
repository, for both debian-based and redhat-based distributions. You can install it directly using the quick-install script:
curl https://docs.varnish-software.com/scripts/setup.sh | TOKEN=INSERT_EXPERIMENTAL_TOKEN_HERE INSTALL="varnish-otel" REPO=experimental bash
varnish-otel
is at the moment configured through environment variables, making it easy to embed in a container or configure with systemd
via a drop-in file.
The table below lists some important variables.
Variable | Description | Possible Values | Default |
---|---|---|---|
OTEL_EXPORTER | Default exporter for logs, metrics and trace | otlp , console , none |
otlp |
OTEL_LOGS_EXPORTER | Logs exporter | otlp , console , none |
OTEL_EXPORTER or otlp |
OTEL_METRICS_EXPORTER | Metrics exporter | otlp , console , none |
OTEL_EXPORTER or otlp |
OTEL_TRACES_EXPORTER | Traces exporter | otlp , console , none |
OTEL_EXPORTER or otlp |
OTEL_EXPORTER_OTLP_PROTOCOL | Default protocol for logs, metrics and trace when using the otlp exporter |
grpc , http/protobuf |
grpc |
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL | Protocol to use when exporting logs with the otlp exporter |
grpc , http/protobuf |
OTEL_EXPORTER_OTLP_PROTOCOL or grpc |
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL | Protocol to use when exporting metrics with the otlp exporter |
grpc , http/protobuf |
OTEL_EXPORTER_OTLP_PROTOCOL or grpc |
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL | Protocol to use when exporting trace with the otlp exporter |
grpc , http/protobuf |
OTEL_EXPORTER_OTLP_PROTOCOL or grpc |
OTEL_RESOURCE_ATTRIBUTES | Allows specifying resource attributes | String | - |
OTEL_SERVICE_NAME | Name of the service used in instrumentation | String | varnish |
OTEL_TRACES_SAMPLER | Defines the sampler for traces | always_on, always_off | always_on |
OTEL_VARNISH_LOG_PROBE | Enables or disables log processing for backend probes | true, false | false |
OTEL_VARNISH_WORKDIR | varnishd ’s -n argument |
String | - |
OTEL_VARNISH_METRICS_FILTER | Specifies filters to include or exclude certain metrics from export, via a comma separated list of globs passed to varnishncsa via -f | String | - |
OTEL_METRIC_EXPORT_INTERVAL | The time interval (in milliseconds) between the start of two export attempts. | Integer | 60000 |
OTEL_METRIC_EXPORT_TIMEOUT | Maximum allowed time (in milliseconds) to export data. | Integer | 30000 |
To get started on some of the most popular observability platforms, check out the subpages in the sidebar.