March 12, 2025
3 min read time

Tech Preview: varnish-otel

Last year, I wrote about the need for observability, touched on how precise the varnish reports can be, how it’s important to be able to present the data and lastly, coming back to Varnish for even more detailed metrics and logs. We also open-sourced varnishlog-json, to accompany varnishncsa and varnishlog and provide even more logging options.

All this was great, but there’s something we didn’t talk about: how do we get all the data exported by Varnish into the observability platform of your choice. Up until recently, that question was highly dependent on the service you were using, for example:

As you can see, the setup is quite different for each because each platform has built their own custom implementation. Nothing we can do about it, right? RIGHT?!

OpenTelemetry waltzes in

Ok, being French, this is going to be one of the hardest things I’ll have to do: admit I am wrong. When I first heard about OpenTelemetry, I immediately thought about XKCD #927 - how could I not?

But, within a few years, OpenTelemetry has managed to bring the largest observability player to the table and has not only provided the industry a standard, but also an SDK for pretty much all notable programming languages. I know what you’re going to say: C isn’t part of the mix. That's true, but you can’t be the granddaddy of all the modern languages and be part of the cool kids, so I’ll let it slide.

With OpenTelemetry, we finally have the promise of “implement once, work everywhere” for observability, and we’ve decided to give it a go.

Observe everything with varnish-otel

Obviously, with all that introduction, you can tell where I’m going: we now have an OpenTelemetry implementation for Varnish, which we have named varnish-otel.

In theory, varnish-otel “just” starts varnishstat and varnishlog-json to aggregate their data, and feeds it to the golang otel SDK, as shown in this diagram:

Logs endpoint

In practice, the benefits for the user are immediate:

  • A single binary to run to handle metrics, tracing and logs
  • Because the endpoints are so standardized, configurations are going to be very similar across all platforms.

Have a look at the different documentation pages for the main observability platforms; you’ll notice they’re quite similar. And now that Prometheus supports otel, the reference Grafana implementation is also much simpler, while also gaining support for tracing.

The tech preview

A couple of weeks ago, varnish-otel entered the tech preview stage, which I’m pretty excited about. In practice, this means that Varnish Enterprise customers can opt-in (contact your account manager!) to get access to beta packages and provide feedback on how they think we should enhance the tool. We’ll be working with them continuously to deliver the first public release planned in June.

If you are interested in trying varnish-otel out, do reach out!