agent icon indicating copy to clipboard operation
agent copied to clipboard

Loki crds

Open EStork09 opened this issue 2 years ago • 2 comments

PR Description

Which issue(s) this PR fixes

Fixes #3395

Notes to the Reviewer

Copied #2604 basically. Would remove the 404 skip check when #9489 closes on the loki repo. Had to use - to seperate rule groups/namespaces, / was not properly passing through the routes, it appears loki needs to align with mimir to handle those, loki is just using Path while mimir is using PathPrefix.

PR Checklist

  • [x] CHANGELOG updated
  • [x] Documentation added
  • [x] Tests updated

EStork09 avatar May 20 '23 21:05 EStork09

Hey @EStork09 how's it going? 👋 Would you have the time to look through the docs suggestions and rebase so we can move ahead with this?

tpaschalis avatar Sep 13 '23 12:09 tpaschalis

@tpaschalis sorry, I have just recently relocated to Europe, I will try to get to this when I can

EStork09 avatar Dec 04 '23 12:12 EStork09

To avoid duplicating so much code it should be possible to put some in the common kubernetes pkg. The client part could also use a common pkg. But we can do this via a follow-up PR and focus on getting this one merged

wildum avatar Feb 27 '24 10:02 wildum

I tested it and it works: I created a local k8s cluster with the agent using the helm chart and the prometheus operator. Then I created the following rule:

apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  creationTimestamp: null
  labels:
    prometheus: example
    role: alert-rules
  name: prometheus-example-rules
spec:
  groups:
  - name: ./example.rules
    rules:
    - alert: ExampleAlert
      expr: rate({job="test", container="my-app"} |= "error" [5m]) > 5

and with this component:

loki.rules.kubernetes "hello" {
          address = "loki-url"
          basic_auth {
              username = "username"
              password = "token"
          }
      }

It successfully pushed the alert to my grafana cloud stack: Screenshot 2024-02-27 at 18 24 51

wildum avatar Feb 27 '24 17:02 wildum

Thansk again @EStork09 and sorry it took so long!

wildum avatar Feb 28 '24 11:02 wildum