apiVersion: v1
kind: ConfigMap
metadata:
  name: cassandra-exporter
  labels:
    app: cassandra
    group: db
data:
  exporter_config.yml: |-
    host: localhost:7199
    ssl: False
    user:
    password:
    listenPort: 8080
    blacklist:
       # To profile the duration of jmx call you can start the program with the following options
       # > java -Dorg.slf4j.simpleLogger.defaultLogLevel=trace -jar cassandra_exporter.jar config.yml --oneshot
       #
       # To get intuition of what is done by cassandra when something is called you can look in cassandra
       # https://github.com/apache/cassandra/tree/trunk/src/java/org/apache/cassandra/metrics
       # Please avoid to scrape frequently those calls that are iterating over all sstables

       # Unaccessible metrics (not enough privilege)
       - java:lang:memorypool:.*usagethreshold.*

       # Leaf attributes not interesting for us but that are presents in many path
       - .*:999thpercentile
       - .*:95thpercentile
       - .*:fifteenminuterate
       - .*:fiveminuterate
       - .*:durationunit
       - .*:rateunit
       - .*:stddev
       - .*:meanrate
       - .*:mean
       - .*:min

       # Path present in many metrics but uninterresting
       - .*:viewlockacquiretime:.*
       - .*:viewreadtime:.*
       - .*:cas[a-z]+latency:.*
       - .*:colupdatetimedeltahistogram:.*

       # Mostly for RPC, do not scrap them
       - org:apache:cassandra:db:.*

       # columnfamily is an alias for Table metrics
       # https://github.com/apache/cassandra/blob/8b3a60b9a7dbefeecc06bace617279612ec7092d/src/java/org/apache/cassandra/metrics/TableMetrics.java#L162
       - org:apache:cassandra:metrics:columnfamily:.*

       # Should we export metrics for system keyspaces/tables ?
       - org:apache:cassandra:metrics:[^:]+:system[^:]*:.*

       # Don't scrap us
       - com:criteo:nosql:cassandra:exporter:.*
    maxScrapFrequencyInSec:
      50:
        - org:apache:cassandra:metrics:cache:.*
        - org:apache:cassandra:metrics:commitlog:.*
        - org:apache:cassandra:metrics:connection:.*
        - org:apache:cassandra:metrics:droppedmessage:.*
        - org:apache:cassandra:metrics:streaming:.*
        - org:apache:cassandra:metrics:table:.*
        - org:apache:cassandra:metrics:threadpools:.*
        - java:lang:.*
      # Refresh those metrics only every hour as it is costly for cassandra to retrieve them
      3600:
        - .*:snapshotssize:.*
        - .*:estimated.*
        - .*:totaldiskspaceused:.*
