What’s New in Loki v0.4.0

Published: 28 Oct 2019 by Ed Welch RSS

v0.4.0 Released!

More frequent releases! We continue to march Loki towards the first GA release, and to help that process we are going to target bi-weekly to weekly releases, depending on changes. - Ed Welch 08/12/2019

My mistake, there was clearly a typo in my previous post, and when I said bi-weekly I clearly meant bi-monthly. ;)

The good news, however, is that the project has been very busy and there are some very exciting new features in Loki v0.4.0!

Querying Metrics From Logs

Starting in v0.4.0, Loki now supports calculating metrics from logs and provides a Prometheus-compatible API! You can now make metric panels directly from your logs:

To use this new functionality today in Grafana, set up a new Prometheus datasource and point it at https://[your-loki-url]/loki. Then you can create metric panels and dashboards like the above example.

There is also active development in Grafana to be able to support these metric-style queries directly against a Loki datasource, so keep your eye on upcoming Grafana releases!

For more information on querying metrics from logs, check out the docs, where you can learn how to use sum, rate, topk, and many other PromQL-style queries against your logs.

Documentation

Speaking of docs! Robert Fratto spent many painstaking hours improving the Loki Documentation, including much-needed sections on Loki Configuration and the HTTP API.

New API

Continuing with my excellent segues between sections… if you look at the HTTP API docs you will see new /loki/api/v1/* endpoints. These will eventually replace the deprecated /api/prom/* endpoints.

We decided to commission a new set of endpoints because breaking changes were required to make a Prometheus-compatible API (specifically the labels format in the current APIs needed to be changed for Prometheus compatibility). We also wanted to do some housekeeping around the paths and JSON models of the API itself.

The /api/prom/* endpoints will continue to work as they do today for the foreseeable future. However, you should consider them deprecated and start migrating to the /loki/api/v1/* endpoints as soon as possible.

What Else?

There were almost 150 PRs included in this release. I invite you to check out the CHANGELOG for the full list.

What’s Next?

Loki continues to creep closer to a v1.0.0 release. Performance and stability have been good for us, and with this last round of API changes we are not expecting much for interface changes in the future.

We are working on a roadmap and prioritizing issues. If there are features you would like to see, add an issue in GitHub or give a thumbs up to existing issues.

But for now, we hope you enjoy Loki v0.4.0!