Skip to content

chore: replace partition promtail with alloy - #592

Merged
Gerrit91 merged 44 commits into
masterfrom
promtail-alloy-migration
Jun 16, 2026
Merged

chore: replace partition promtail with alloy#592
Gerrit91 merged 44 commits into
masterfrom
promtail-alloy-migration

Conversation

@ma-hartma

@ma-hartma ma-hartma commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Description

Replaces promtail with alloy in the partition.
There is an own PR for the control-plane replacement: #595.

  • deploy alloy
    • role for docker service in partition (switches and management servers)
  • convert existing configs
    • convert existing scrape configs with alloy convert and re-templated them
    • provide as snippets
    • multiple loki targets
    • timeouts and basic auth for loki targets
  • logs and metrics for alloy itself (https://grafana.com/docs/alloy/latest/collect/metamonitoring/=) to loki and prometheus
    • partition
    • document prometheus_alloy targets
  • positions file
  • old labels

Question Marks:

  • prometheus inside the partition could be replaced with alloy completely as it can pick up the metrics as well, but aggregation would have to be re-evaluated

After successful replacement

Manually tested in mini-lab:

  • syslog snippet
  • syslog snippet with positions file
  • journal snippet
  • docker snippet
  • journal-file snippet with /run/log/journal and /var/log/journal
  • journal-file snippet with positions file, missing positions name and existing positions name
  • alloy-meta snippet
  • metrics are collected via prometheus
  • labels as expected (logs and alloy metrics)
  • cutover migration from promtail to alloy in the mini-lab with existing positions files and stopping promtail

References:

Closes #552

Used AI-Tools ✨

  • Claude Sonnet 4.6 for docs and migration guide generation and jinja templating

Release Notes

Required Actions

The partition `promtail` role is deprecated and replaced by the new `alloy` role. Operators should migrate to Alloy for partition log collection.

Follow the migration instructions: https://github.com/metal-stack/metal-roles/blob/master/partition/roles/alloy/README.md#migration-from-promtail

Several migration scenarios are supported — from a hard cutover to a parallel run for verification before switching over. Note that running both services simultaneously will produce duplicate log entries in Loki during the transition window.

@metal-robot metal-robot Bot added the area: deployment Affects the deployment area. label Apr 29, 2026
@ma-hartma ma-hartma changed the title WIP: install alloy with default configuration chore: replace promtail with alloy Apr 29, 2026
Comment thread control-plane/roles/logging/tasks/main.yaml Outdated
@ma-hartma
ma-hartma force-pushed the promtail-alloy-migration branch from 719b079 to 1d027c9 Compare April 30, 2026 14:31
Comment thread partition/roles/alloy/defaults/main.yaml Outdated
@iljarotar iljarotar moved this to In Progress in Development May 4, 2026
@ma-hartma
ma-hartma force-pushed the promtail-alloy-migration branch 2 times, most recently from 8c63715 to 7e9458e Compare May 4, 2026 15:36
@ma-hartma ma-hartma changed the title chore: replace promtail with alloy chore: replace partition promtail with alloy May 4, 2026
@ma-hartma
ma-hartma marked this pull request as ready for review May 6, 2026 13:29
@ma-hartma
ma-hartma requested review from a team as code owners May 6, 2026 13:29
@ma-hartma
ma-hartma requested a review from iljarotar May 6, 2026 13:29
@ma-hartma
ma-hartma force-pushed the promtail-alloy-migration branch 2 times, most recently from ebd72d6 to 78c5ad6 Compare May 6, 2026 13:40

@Gerrit91 Gerrit91 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You put a lot of thought into it, which I enjoy. Also things are implemented very thoughtfully. It just could be a bit less complex here and there to my taste. :D

Comment thread partition/roles/alloy/meta/main.yml
Comment thread partition/roles/alloy/tasks/main.yaml Outdated
Comment thread partition/roles/alloy/tasks/main.yaml Outdated
Comment thread partition/roles/alloy/tasks/main.yaml
Comment thread partition/roles/alloy/tasks/main.yaml Outdated
Comment thread partition/roles/monitoring/prometheus/README.md
Comment thread partition/roles/promtail/defaults/main.yaml Outdated
Comment thread partition/roles/promtail/tasks/main.yaml Outdated
Comment thread partition/roles/alloy/defaults/main.yaml Outdated
@ma-hartma

Copy link
Copy Markdown
Contributor Author

You put a lot of thought into it, which I enjoy. Also things are implemented very thoughtfully. It just could be a bit less complex here and there to my taste. :D

Thanks for the extensive review!
Well, it was my first Ansible role and I haven't used it before, so maybe I took some things too serious! :D
I'll try to apply your proposed changes ASAP to be able to get the PR into the next release.

@ma-hartma
ma-hartma requested a review from Gerrit91 June 12, 2026 07:30
@ma-hartma
ma-hartma force-pushed the promtail-alloy-migration branch from 2cc003b to 876a2b6 Compare June 12, 2026 22:21
Comment thread partition/roles/promtail/handlers/main.yaml Outdated
@Gerrit91
Gerrit91 merged commit 5f150d8 into master Jun 16, 2026
6 checks passed
@Gerrit91
Gerrit91 deleted the promtail-alloy-migration branch June 16, 2026 11:28
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Development Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: deployment Affects the deployment area. area: partition Affects the partition area. requires docs update For merging this pull request, an update in metal-stack.io/docs is required.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Introduce Alloy as promtail Replacement

4 participants