Skip to content

fix(loki.write): WAL writer metrics is now collected after reload - #7093

Merged
kalleep merged 2 commits into
mainfrom
kalleep/fix-loki-wal-writer-metrics
Sep 14, 2026
Merged

kalleep merged 2 commits into
mainfrom
kalleep/fix-loki-wal-writer-metrics

Conversation

@kalleep

@kalleep kalleep commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Brief description of Pull Request

Fix WAL writer metrics after config reload.

Pull Request Details

Writer metrics was registered with reg.Register. This one will return an error if we have already registered these metrics before, but the code ignored this error.

Because of that writer would update metrics that was not collected anymore after a reload happened. I changed it to accept a metrics struct instead to match other code here and use our util function when registering the metric.

Issue(s) fixed by this Pull Request

Part of: #7094

Notes to the Reviewer

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated
  • This pull request was substantially generated with AI assistance (see the GenAI policy)

@kalleep
kalleep requested a review from a team as a code owner September 11, 2026 13:56
@kalleep kalleep changed the title fix(loki.write): WAL writer metrics is now updated after reload fix(loki.write): WAL writer metrics is now collected after reload Sep 11, 2026

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.

I think the tests are not able still to discover this as a bug. Would it be possible to add a check for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@kalleep
kalleep force-pushed the kalleep/fix-loki-wal-writer-metrics branch from a59e228 to 8e02a5e Compare September 14, 2026 13:30
@kalleep
kalleep force-pushed the kalleep/fix-loki-wal-writer-metrics branch from 8e02a5e to 5ab1b95 Compare September 14, 2026 13:31
@kalleep
kalleep merged commit f6bf023 into main Sep 14, 2026
52 of 54 checks passed
@kalleep
kalleep deleted the kalleep/fix-loki-wal-writer-metrics branch September 14, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants