{"id":22131084,"url":"https://github.com/slamdev/cortex-rule-watcher","last_synced_at":"2026-01-19T13:01:53.606Z","repository":{"id":40381168,"uuid":"484476350","full_name":"slamdev/cortex-rule-watcher","owner":"slamdev","description":"Cortex ruler sidecar to sync PrometheusRule resources","archived":false,"fork":false,"pushed_at":"2024-08-15T10:34:45.000Z","size":53,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T20:41:55.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slamdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-22T15:06:51.000Z","updated_at":"2022-08-18T09:50:39.000Z","dependencies_parsed_at":"2023-10-25T19:33:35.081Z","dependency_job_id":"b04ef019-9ae6-4050-9d41-223cba3c7067","html_url":"https://github.com/slamdev/cortex-rule-watcher","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":"0.15000000000000002","last_synced_commit":"39952c65fc2b5191a6e25a382bfda1ee91e7f0ac"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/slamdev/cortex-rule-watcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fcortex-rule-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fcortex-rule-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fcortex-rule-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fcortex-rule-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slamdev","download_url":"https://codeload.github.com/slamdev/cortex-rule-watcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fcortex-rule-watcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28568833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T18:29:39.230Z","updated_at":"2026-01-19T13:01:53.573Z","avatar_url":"https://github.com/slamdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cortex-rule-watcher \u003ca href=\"https://hub.docker.com/r/slamdev/cortex-rule-watcher\"\u003e\u003cimg alt=\"status\" src=\"https://img.shields.io/docker/v/slamdev/cortex-rule-watcher\"\u003e\u003c/a\u003e\n\nRuler component in [Cortex](https://github.com/cortexproject/cortex)/[Mimir](https://github.com/grafana/mimir) \ndoes not support rules extraction from [PrometheusRule](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/alerting.md#prometheusrule-labelling) resources.\n\n**cortex-rule-watcher** can help you with that. It can be added as a sidecar container to the ruler deployment and\nwill watch for the changes in PrometheusRule resources in the cluster. As soon as it sees a change in PrometheusRule resource,\nit will dump the PrometheusRule spec to the file, that will be synced by ruler component.\n\n[Click to see a full example](example/example.yaml)\n\nOr use this configuration for [mimir helm chart](https://github.com/grafana/helm-charts/tree/mimir-distributed-2.0.7/charts/mimir-distributed):\n\n```yaml\nruler:\n  extraContainers:\n    - name: cortex-rule-watcher\n      args:\n        - --rule-path=/local-rules\n      image: slamdev/cortex-rule-watcher:latest\n      imagePullPolicy: Always\n      ports:\n        - name: http-health\n          containerPort: 8081\n        - name: http-metrics\n          containerPort: 8082\n      livenessProbe:\n        httpGet:\n          path: /healthz\n          port: 8081\n        initialDelaySeconds: 15\n        periodSeconds: 20\n      readinessProbe:\n        httpGet:\n          path: /readyz\n          port: 8081\n        initialDelaySeconds: 5\n        periodSeconds: 10\n      resources:\n        requests:\n          cpu: 10m\n          memory: 16Mi\n      volumeMounts:\n        - name: rules\n          mountPath: /local-rules\n  extraVolumes:\n    - name: rules\n      emptyDir: { }\n  extraVolumeMounts:\n    - name: rules\n      mountPath: /ruler/fake\n  extraArgs:\n    ruler-storage.backend: local\n    ruler-storage.local.directory: /ruler\n```\n\nBesides that you have to have a cluster role and binding:\n\n```yaml\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRole\nmetadata:\n  name: mimir-distributed-cortex-rule-watcher\nrules:\n  - apiGroups:\n      - monitoring.coreos.com\n    resources:\n      - prometheusrules\n    verbs:\n      - get\n      - list\n      - watch\n---\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: mimir-distributed-cortex-rule-watcher\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: mimir-distributed-cortex-rule-watcher\nsubjects:\n  - kind: ServiceAccount\n    name: mimir-distributed\n    namespace: monitoring\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdev%2Fcortex-rule-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslamdev%2Fcortex-rule-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdev%2Fcortex-rule-watcher/lists"}