Skip to content

Add a new mimir.alerts.kubernetes component#3448

Merged
ptodev merged 8 commits intomainfrom
504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex
Nov 19, 2025
Merged

Add a new mimir.alerts.kubernetes component#3448
ptodev merged 8 commits intomainfrom
504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex

Conversation

@ptodev
Copy link
Contributor

@ptodev ptodev commented Apr 25, 2025

PR Description

Which issue(s) this PR fixes

Fixes #504

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch 2 times, most recently from 46e4b8d to 9a02eae Compare May 1, 2025 21:19
@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch from 9a02eae to ca15a30 Compare May 26, 2025 11:13
@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2025

@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch 3 times, most recently from 2de59c8 to cb30ab7 Compare May 27, 2025 12:55
@vladst3f
Copy link

vladst3f commented Jun 6, 2025

hi! we would interested in using this - what's the plan to merge it ?
thanks!

@ptodev
Copy link
Contributor Author

ptodev commented Jun 16, 2025

Hi @vladst3f! I'm still hopeful that this can go into the next Alloy release. However, I had a lot of trouble updating the go.mod file last time I tried to update the PR. There was a dependency which another one of Alloy's dependencies wanted on the latest version but other dependencies weren't compatible with the latest version. I might need to fork some dependencies in order to merge the PR.

@ptodev
Copy link
Contributor Author

ptodev commented Jul 21, 2025

I hope we will be able to merge this PR in August, shortly after Go 1.25 is released.

The reason why it has been delayed is due to "diamond dependencies". Alloy has three dependencies which depend on k8s.io/ Go modules - Prometheus Operator, OTel Collector Contrib, and Prometheus itself. Prometheus Operator upgraded to v0.33 of k8s.io/, which also requires Go 1.24. However, OTel Collector Contrib and Prometheus can't upgrade to that version of k8s because they can't upgrade their Go version because they're commietd to supporting the last 2 versions of Go. This requires them to always be on the next to last version of Go. It seems that Prometheus was upgraded for a bit (probably accidentally) and then reverted. For OTel Collector there is a PR for the k8s upgrade and an issue for the Go upgrade.

The alternative to waiting is for me to make a fork of Prometheus Operator under the Grafana GitHub org, but I'm reluctant to do this due to the extra maintenance cost.

@sebt3
Copy link

sebt3 commented Aug 27, 2025

An august merge sound optimistic by now :(
We're waiting for : prometheus/prometheus#16890
which itself wait for : prometheus/prometheus#17090
After these 2 are merged, then the OTel MR can be merged, and after this one.

@vladst3f
Copy link

vladst3f commented Oct 2, 2025

@ptodev, @sebt3 , prometheus/prometheus#17200 got merged last week. So can this progress now ?

thanks !

@sebt3
Copy link

sebt3 commented Oct 2, 2025

@vladst3f I'm just a user willing to finish a migration (just like you probably). @ptodev mentionned open-telemetry/opentelemetry-collector-contrib#39725 which is still not merged. So the waiting game is still outside of alloy. I'm pretty sure once all the external dependencies are finally merged will see this PR merged

@ptodev
Copy link
Contributor Author

ptodev commented Oct 7, 2025

Unfortunately, we do need OTel to be upgraded first. Otherwise there'd be compilation errors. For example, the OTel k8s attributes processor depends on openshift/client-go which also needs to be updated:

└─▪ go mod why -m github.com/openshift/client-go
# github.com/openshift/client-go
github.com/grafana/alloy/internal/component/otelcol/processor/k8sattributes
github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig
github.com/openshift/client-go/quota/clientset/versioned

@sebt3
Copy link

sebt3 commented Nov 1, 2025

Finally : open-telemetry/opentelemetry-collector-contrib#43890 and openshift/client-go#343

imho, all is set now :)

@ron1
Copy link

ron1 commented Nov 6, 2025

Hi @ptodev , are you able to confirm all dependencies are now in place for this to be merged?

@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch 2 times, most recently from 85bad8d to e2d3fb0 Compare November 7, 2025 16:37
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

💻 Deploy preview deleted (Add a new mimir.alerts.kubernetes component).

@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch from e2d3fb0 to 2bc34ce Compare November 7, 2025 17:22
@ptodev
Copy link
Contributor Author

ptodev commented Nov 7, 2025

Hi folks, thank you for the reminders. I was able to rebase the branch and to build it successfully. I'll try to polish it and to open it for review by Tuesday/Wednesday next week. I'm optimistic that it'll make it to Alloy v1.12.0.

Copy link

@ron1 ron1 left a comment

Choose a reason for hiding this comment

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

Be sure to update helm chart as well with changes similar to

# -- Rules required for the `mimir.rules.kubernetes` component.

@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch from 2bc34ce to 8c33e26 Compare November 10, 2025 15:25
@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch from 7902ae6 to b32ea3c Compare November 17, 2025 11:37
@ptodev ptodev requested a review from kalleep November 17, 2025 11:38
@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch from b32ea3c to b5309b4 Compare November 17, 2025 13:25
@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch 2 times, most recently from 6f65213 to ad08e6d Compare November 18, 2025 13:58
Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Approving for docs

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Nov 18, 2025
@ptodev ptodev force-pushed the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch from 9588ff3 to a39e8b8 Compare November 19, 2025 09:49
@ptodev
Copy link
Contributor Author

ptodev commented Nov 19, 2025

Hi @ron1, yes, this will be in v1.12. It wasn't in the first release candidate, but it will go in the second one.

@ptodev ptodev merged commit 6f2396e into main Nov 19, 2025
47 checks passed
@ptodev ptodev deleted the 504-listen-for-alertmanagerconfig-crds-and-configure-alertmanager-in-grafana-mimircortex branch November 19, 2025 11:06
@ron1
Copy link

ron1 commented Nov 19, 2025

@ptodev Thanks much for your efforts to get this feature merged!

ptodev added a commit that referenced this pull request Nov 19, 2025
* Add a new mimir.alerts.kubernetes component

* Sync Mimir periodically, test the case of a CRD deletion

* Add TODOs

* Longer test timeout

* Check if pods are running

* Apply suggestions from code review

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Fix metric doc

* Fix changelog

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
@ptodev ptodev mentioned this pull request Nov 19, 2025
jharvey10 added a commit that referenced this pull request Nov 19, 2025
* fix: no longer drop request if stream is dropped in loki.source.api (#4834)

* fix: add ForceShutdown that will cancel in-flight requests before
stopping server

* Split into multiple files and add LogsBatchReceiver

* don't drop request when relabel rules drops a specific stream

* fix: use loki.LogsBatchReceiver to ensure all entries in a request is sent down the
pipeline

* add changelog

* add checks for entries and use sync once to close channel

* update changelog for next rc

* Fix flaky tests: port in for loki source api tests and logs integration test (#4875)

* Fix port in use flakyness for loki source api tests

* Pin loki container version for integration tests

* Add a new mimir.alerts.kubernetes component (#3448)

* Add a new mimir.alerts.kubernetes component

* Sync Mimir periodically, test the case of a CRD deletion

* Add TODOs

* Longer test timeout

* Check if pods are running

* Apply suggestions from code review

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Fix metric doc

* Fix changelog

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Remove experimental flag from stage.windowsevent (#4879)

---------

Co-authored-by: Karl Persson <23356117+kalleep@users.noreply.github.com>
Co-authored-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
dehaansa pushed a commit to madhub/alloy that referenced this pull request Dec 10, 2025
* Add a new mimir.alerts.kubernetes component

* Sync Mimir periodically, test the case of a CRD deletion

* Add TODOs

* Longer test timeout

* Check if pods are running

* Apply suggestions from code review

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Fix metric doc

* Fix changelog

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age type/docs Docs Squad label across all Grafana Labs repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Listen for AlertManagerConfig CRDs and configure Alertmanager in Grafana Mimir/Cortex

6 participants