Promtail-based log streaming to Loki (LogProxyConsumer) is scheduled for deprecation

Now that pebble log forwarding is generally available (pebble, juju, ops, loki-k8s), the observability team plans to deprecate the use of promtail for streaming logs (PR). This means that the charms.loki_k8s.v1.loki_push_api.LogProxyConsumer object will not be available in v2 of the loki_push_api charm library.

Existing charm code will not break, and streaming logs to loki would still be possible as before, but we will not be introducing new promtail-related features to v0 or v1.

Why the change?

Promtail was always an awkward external dependency that the charm lib would download on the fly from a hard-coded github release URL. This works fine, but is inconvenient to work around in air-gapped environments. Now that pebble log forwarding is available, we no longer need promtail, which simplifies things from an external dependecies point of view.

Who is affected?

Admins of k8s charms that have a logging relation to loki and need to keep running air-gapped on models with Juju < 3.4.1. (VM charms use grafana-agent for log streaming so promtail was never used there in the first place.)

  • For regular deployments (not air-gapped), no change is necessary, but we recommend to plan your migration to LogForwarder (example).
  • For charms that are planned to be deployed air-gapped on models with Juju >= 3.4.1, migrate to LogForwarder (example). If you continue to rely on LogProxyConsumer, you would probably need to set up some kind of proxy to serve promtail via the hard-coded URL.
  • For charms that are planned to be deployed air-gapped on models with Juju < 3.4.1, you would probably need to set up some kind of proxy to serve promtail via the hard-coded URL.

See also the github search results for a partial list of potentially affected charms.

To check if your code base may be affected, you could run:

find ~/code -maxdepth 3 -type f -name "*.py" -exec grep "LogProxyConsumer(" {} + | grep -v loki_push_api.py

When is this coming?

Soon after Juju 3.6 LTS is stable.

Contact

You can reach out via our matrix room.

1 Like