Recording rules/alerts with Terraform

77 views
Skip to first unread message

Vincent Miszczak

unread,
Apr 25, 2023, 12:24:55 PM4/25/23
to lokiproject
Hello,

Is there anything or any plan that allows interacting with the Ruler using Terraform to set up recording rules/alerts?
My org has tons of apps that do not use Kubernetes, and we already manage alerts with Terraform for other backends (Cloudwath, Datadog, Sumologic, ...). Terraform sounds like the most natural way for us, do you have input about this?

I tried to ask the question on Slack but got no feedback :/

Thank you!

Danny Kopping

unread,
Apr 26, 2023, 8:23:46 AM4/26/23
to lokiproject
Hi Vincent

Unfortunately we do not have a way to provision rules using Terraform right now. It's a nice idea and we welcome contributions!
https://grafana.com/docs/loki/latest/rules/#interacting-with-the-ruler provides a guide on how to provision rules programmatically.

Hope that helps!

Vincent Miszczak

unread,
Apr 27, 2023, 10:57:33 AM4/27/23
to lokiproject
Hello, 

Thank you for the feedback! 

I went for a custom provider derived from https://github.com/fgouteroux/terraform-provider-mimir that is able to speak to both Mimir and Loki using the same Terraform resources.

It's still early and we'll need to use it for some time, but we may make a public release if it's fine.

François GOUTEROUX

unread,
Sep 1, 2023, 6:40:24 AM9/1/23
to lokiproject
hello,

For my org, we had the same need, so I release the loki tf provider https://github.com/fgouteroux/terraform-provider-loki, if it can help.

Cyril Tovena

unread,
Sep 4, 2023, 5:07:01 AM9/4/23
to François GOUTEROUX, lokiproject
This is awesome ! We should advertise this in our docs.

--
You received this message because you are subscribed to the Google Groups "lokiproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lokiproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lokiproject/5e93e307-0552-4743-b95a-557b5292c2f7n%40googlegroups.com.

Danny Kopping

unread,
Sep 5, 2023, 4:21:45 AM9/5/23
to lokiproject
Agreed! This is fantastic. Thanks very much Francois!
Reply all
Reply to author
Forward
0 new messages