Eevans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379610 )

Change subject: Configure agent to export Cassandra histogram metrics
......................................................................

Configure agent to export Cassandra histogram metrics

Adds a new rule matching Cassandra histogram metrics.

Additionally, filters `type=ColumnFamily` (redundant to `type=Table`),
`type=Keyspace`, and any metrics for the `meta` tables (all more or
less consistent with what is done in cassandra-metrics-collector).

Bug: T171772
Change-Id: If73b32fe30aa2b29bf9a585ca31ea3afda6bf059
---
R modules/cassandra/files/prometheus_jmx_exporter-2.1.yaml
A modules/cassandra/files/prometheus_jmx_exporter-2.2.yaml
A modules/cassandra/files/prometheus_jmx_exporter-3.x.yaml
A modules/cassandra/files/prometheus_jmx_exporter-dev.yaml
M modules/cassandra/manifests/instance.pp
5 files changed, 25 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/10/379610/1

diff --git a/modules/cassandra/files/prometheus_jmx_exporter.yaml 
b/modules/cassandra/files/prometheus_jmx_exporter-2.1.yaml
similarity index 100%
rename from modules/cassandra/files/prometheus_jmx_exporter.yaml
rename to modules/cassandra/files/prometheus_jmx_exporter-2.1.yaml
diff --git a/modules/cassandra/files/prometheus_jmx_exporter-2.2.yaml 
b/modules/cassandra/files/prometheus_jmx_exporter-2.2.yaml
new file mode 120000
index 0000000..f18d738
--- /dev/null
+++ b/modules/cassandra/files/prometheus_jmx_exporter-2.2.yaml
@@ -0,0 +1 @@
+prometheus_jmx_exporter-2.1.yaml
\ No newline at end of file
diff --git a/modules/cassandra/files/prometheus_jmx_exporter-3.x.yaml 
b/modules/cassandra/files/prometheus_jmx_exporter-3.x.yaml
new file mode 100644
index 0000000..58eb0a0
--- /dev/null
+++ b/modules/cassandra/files/prometheus_jmx_exporter-3.x.yaml
@@ -0,0 +1,21 @@
+---
+lowercaseOutputLabelNames: true
+lowercaseOutputName: true
+blacklistObjectNames:
+  - "org.apache.cassandra.metrics:type=ColumnFamily,*"
+  - "org.apache.cassandra.metrics:type=Keyspace,*"
+rules:
+  - pattern: org.apache.cassandra.metrics<type=(Connection|Streaming), 
scope=(\S*), name=(\S*)><>(Count|Value)
+    name: cassandra_$1_$3
+    labels:
+      address: "$2"
+  - pattern: org.apache.cassandra.metrics<type=(\S*)(?:, 
((?!scope)\S*)=(\S*))?(?:, scope=((?!meta)\S*))?, 
name=(\S*)><>(50|75|95|99)thPercentile
+    name: cassandra_$1_$5_$6p
+    labels:
+      "$1": "$4"
+      "$2": "$3"
+  - pattern: org.apache.cassandra.metrics<type=(\S*)(?:, 
((?!scope)\S*)=(\S*))?(?:, scope=((?!meta)\S*))?, name=(\S*)><>(Count|Value)
+    name: cassandra_$1_$5
+    labels:
+      "$1": "$4"
+      "$2": "$3"
diff --git a/modules/cassandra/files/prometheus_jmx_exporter-dev.yaml 
b/modules/cassandra/files/prometheus_jmx_exporter-dev.yaml
new file mode 120000
index 0000000..0f1b806
--- /dev/null
+++ b/modules/cassandra/files/prometheus_jmx_exporter-dev.yaml
@@ -0,0 +1 @@
+prometheus_jmx_exporter-3.x.yaml
\ No newline at end of file
diff --git a/modules/cassandra/manifests/instance.pp 
b/modules/cassandra/manifests/instance.pp
index 955d16f..8890080 100644
--- a/modules/cassandra/manifests/instance.pp
+++ b/modules/cassandra/manifests/instance.pp
@@ -213,7 +213,7 @@
 
     # the following parameters have defaults that are sane both for single-
     # and multi-instances
-    $jmx_exporter_enabled = false,
+    $jmx_exporter_enabled             = false,
     $num_tokens                       = 256,
     $authenticator                    = true,
     $authorizor                       = true,
@@ -416,7 +416,7 @@
 
     file { "${config_directory}/prometheus_jmx_exporter.yaml":
         ensure  => present,
-        source  => 
"puppet:///modules/${module_name}/prometheus_jmx_exporter.yaml",
+        source  => 
"puppet:///modules/${module_name}/prometheus_jmx_exporter-${target_version}.yaml",
         owner   => 'cassandra',
         group   => 'cassandra',
         mode    => '0400',

-- 
To view, visit https://gerrit.wikimedia.org/r/379610
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If73b32fe30aa2b29bf9a585ca31ea3afda6bf059
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Eevans <eev...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to