https://github.com/slamdev/promrule-exporter
https://github.com/slamdev/promrule-exporter
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/slamdev/promrule-exporter
- Owner: slamdev
- License: apache-2.0
- Created: 2022-08-19T09:04:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T20:16:41.000Z (over 2 years ago)
- Last Synced: 2025-06-10T11:44:32.327Z (10 months ago)
- Language: Go
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# promrule-exporter
A simple tool that exports all PrometheusRule resources from a cluster and converts them to a set of files in
[native rule format](https://cortexmetrics.io/docs/api/#example-response) that is readable by cortex or mimir.
This tool is meant to be used as a CronJob together with [cortextool](https://github.com/grafana/cortex-tools) or
[mimirtool](https://grafana.com/docs/mimir/latest/operators-guide/tools/mimirtool/).
E.g.:
```yaml
apiVersion: batch/v1
kind: CronJob
metadata:
name: rule-syncer
spec:
schedule: "*/5 * * * *"
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
initContainers:
- name: promrule-exporter
image: slamdev/promrule-exporter
args: [ '--exclude-alert-rules=true', '--output-dir=/out' ]
volumeMounts:
- name: rules
mountPath: /out
containers:
- name: rule-syncer
image: grafana/mimirtool:2.2.0
args: [ 'rules', 'sync', '--address=http://mimir', '--id=anonymous', '--rule-dirs=/in' ]
volumeMounts:
- name: rules
mountPath: /in
volumes:
- name: rules
emptyDir: { }
```