Skip to content

v2.4.0

Compare
Choose a tag to compare
@slim-bean slim-bean released this 05 Nov 22:27
v2.4.0
3987933

🎊 🌮 Loki 2.4.0 🌮 🎊

With Loki 2.4 we’ve focused on 2 main things:

  1. Making it easier than ever to get your logs into Loki.
  2. Making it easier to run and operate, anyone not using Kubernetes or allergic to microservices should pay close attention, this release has a lot for you.

Features and enhancements

  • Loki no longer requires logs to be sent in perfect chronological order. Support for out of order logs is one of the most highly requested features for Loki and in 2.4 the strict ordering constraint has been removed.
  • Scaling Loki is now much easier with a hybrid mode between a single binary and microservices we are calling the Simple Scalable Deployment. It’s now possible to scale Loki with new read and write targets. Where previously you would have needed Kubernetes and the microservices approach to start tapping into Loki’s potential, it’s now possible to do this in a much simpler way.
  • We introduced a common config section and updated and updated a lot of defaults. This results in a 70% smaller Loki config and comes out of the box with more appropriate defaults and limits. Check out the example local config as the new reference for running Loki.
  • Recording rules are no longer marked experimental and have a much more resilient implementation which leverages the existing write ahead log code in Prometheus.
  • Do you use Kafka for your logs? You should check out the new Promtail Kafka Consumer which can easily get your logs out of Kafka and into Loki.
  • LogQL has received some nice enhancements thanks to the amazing Loki community in the form of group_left and group_right as well as the label_format and line_formatfunctions now support working with dates and times
  • Another great community contribution to Promtail allows it to accept ndjson and plaintext log files over HTTP.

All in all about 260 PR’s went into Loki 2.4 and we thank everyone for helping us make the best Loki yet.

For a full list of all changes please look at the CHANGELOG

Upgrade Considerations

Please read the upgrade guide before updating Loki.

We made a lot of changes to Loki’s configuration as part of this release, we have tried our best to make sure changes are compatible with existing configurations however some changes to default limits may impact users who didn't have values explicitly set for these limits in their config files.

Here is a list of limits changed:

config new default old default
ingestion_rate_strategy "global" "local"
max_global_streams_per_user 5000 0 (no limit)
max_query_length "721h" "0h" (no limit)
max_query_parallelism 32 14
max_streams_per_user 0 (no limit) 10000
reject_old_samples true false
reject_old_samples_max_age "168h" "336h"
per_stream_rate_limit 3MB -
per_stream_rate_limit_burst 15MB -

Also we have enabled the in-memory FIFO cache by default when no existing external cache is configured. This helps improve Loki's performance however it will also allow Loki to consume more memory.

Bug fixes

Lists of bug fixes for 2.4.x.

2.4.0 bug fixes

Here is a list of some of the more important fixes in 2.4.0:

  • 4598 kavirajk: Fix ip matcher lexer to differentiate filter from identifier
  • 4563 cyriltovena: Fixes the Series function to handle properly sharding.
  • 4518 slim-bean: Loki: Fix bug where items are returned to a sync.Pool incorrectly
  • 4411 slim-bean: Loki: Bug: frontend waiting on results which would never come
  • 4238 liguozhong: [fix] distributor: fix goroutine leak

Security fixes

List of security fixes for 2.4.x

2.4.0 security fixes

2.4.0 contains one fix which is security related

4627 Loki: Explicitly define allowed HTTP methods on HTTP endpoints

A community user noticed that all Loki endpoints would respond to HTTP OPTIONS requests, and the proxy they placed in front of Loki responsible for HTTP authentication would pass OPTIONS requests unauthenticated to Loki allowing users to make unauthenticated/unauthorized queries to Loki. This PR restricts the type of HTTP methods allowed on each endpoint and disallows OPTIONS requests.

Installation:

The components of Loki are currently distributed in plain binary form and as Docker container images. Choose what fits your use-case best.

Docker container:

$ docker pull "grafana/loki:2.4.0"
$ docker pull "grafana/promtail:2.4.0"

Binary

We provide pre-compiled binary executables for the most common operating systems and architectures.
Choose from the assets below for the application and architecture matching your system.
Example for Loki on the linux operating system and amd64 architecture:

$ curl -O -L "https://github.com/grafana/loki/releases/download/v2.4.0/loki-linux-amd64.zip"
# extract the binary
$ unzip "loki-linux-amd64.zip"
# make sure it is executable
$ chmod a+x "loki-linux-amd64"