canonical / cassandra-k8s-operator

Apache License 2.0
1 stars 4 forks source link

jmx-exporter YAML values should be templated to match the charm app name #25

Open rbarry82 opened 3 years ago

rbarry82 commented 3 years ago

See, for example:

rules:
# Generic gauges with 0-2 labels
- pattern: org.apache.cassandra.metrics<type=(\S*)(?:, ((?!scope)\S*)=(\S*))?(?:, scope=(\S*))?, name=(\S*)><>Value
  name: cassandra_$1_$5
  type: GAUGE
  labels:
    "$1": "$4"
    "$2": "$3"

If multiple Cassandra applications are exporting metrics to Prometheus for any reason (when/once we get to cross-model LMA), their metrics will stomp all over each other.

Trivially:

rules:
# Generic gauges with 0-2 labels
- pattern: org.apache.cassandra.metrics<type=(\S*)(?:, ((?!scope)\S*)=(\S*))?(?:, scope=(\S*))?, name=(\S*)><>Value
  name: {{ self.charm.app.name }}_cassandra_$1_$5
  type: GAUGE
  labels:
    "$1": "$4"
    "$2": "$3"

Would at least resolve the name, even it it would not affect the labels