Skip to content

Commit

Permalink
Fixes k8ssandra#1563 Invalid Metric name in prometheus based on k8ssa…
Browse files Browse the repository at this point in the history
…ndra-operator fix 927
  • Loading branch information
RomainAnselin committed Apr 15, 2024
1 parent 74900a9 commit 6002044
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ and date `## vX.Y.Z - YYYY-MM-DD` and create a new placeholder section for `unr
* [BUGFIX] [#1404](https://github.com/k8ssandra/k8ssandra/issues/1404) Fix `garbage_collector` property to use G1GC
* [ENHANCEMENT] [#1135](https://github.com/k8ssandra/k8ssandra/issues/1135) Add support for service account annotations in helm chart.
* [ENHANCEMENT] [#1612](https://github.com/k8ssandra/k8ssandra/issues/1612) Add support for nodeSelector and tolerations in cass-operator helm chart.
* [BUGFIX] [#1563](https://github.com/k8ssandra/k8ssandra/issues/) Prometheus "invalid metric name or label names" error while scraping cassandra metrics
24 changes: 21 additions & 3 deletions charts/k8ssandra/templates/prometheus/service_monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,27 @@ spec:
sourceLabels:
- mcac
targetLabel: __name__
- regex: org\.apache\.cassandra\.metrics\.hints_service\.hints_delays\-(\w+)
- action: replace
regex: org\.apache\.cassandra\.metrics\.hints_service\.hint_delays[\-\.]([\w\.]+)
replacement: ${1}
sourceLabels:
- mcac
targetLabel: peer_ip
- regex: org\.apache\.cassandra\.metrics\.hints_service\.hints_delays\-(\w+)
replacement: mcac_hints_hints_delays
- action: replace
regex: org\.apache\.cassandra\.metrics\.hints_service\.hint_delays[\-\.]([\w\.]+)
replacement: mcac_hints_hint_delays
sourceLabels:
- mcac
targetLabel: __name__
- action: replace
regex: org\.apache\.cassandra\.metrics\.hints_service\.hints_created[\-\.]([\w\.]+)
replacement: ${1}
sourceLabels:
- mcac
targetLabel: peer_ip
- action: replace
regex: org\.apache\.cassandra\.metrics\.hints_service\.hints_created[\-\.]([\w\.]+)
replacement: mcac_hints_hint_created
sourceLabels:
- mcac
targetLabel: __name__
Expand Down Expand Up @@ -308,4 +322,8 @@ spec:
targetLabel: __name__
- action: labeldrop
regex: prom_name
- action: drop
regex: (.*)\.+(.*)
sourceLabels:
- __name__
{{- end }}

0 comments on commit 6002044

Please sign in to comment.