-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscriptable-jmx-exporter.yaml
54 lines (54 loc) · 2.57 KB
/
scriptable-jmx-exporter.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
options:
include_timestamp: false
declarations: |
public static V1.Builder kafka(AttributeValue in, String name) {
return V1.name(in.domain, (String) in.keyProperties.get("type"), name)
.addLabelsExcluding(in.keyProperties, "type", "name")
.timestamp(in.timestamp)
.help(in.attributeDescription);
}
rules:
- pattern:
- com.sun.management:type=HotSpotDiagnostic:DiagnosticOptions
- java.lang:type=Threading:AllThreadIds
- jdk.management.jfr
- kafka.*::MeanRate|.*MinuteRate # can be calculated using rate()
- kafka.*::RateUnit|LatencyUnit|EventType # unsupported type
- kafka:type=kafka.Log4jController
- kafka.server:type=app-info:commit-id|version # reports wrong type
# NOTE: The two patterns below is added to more closely match with the bahavior (whether it's intentional or not) of jmx_exporter's kafka-2_0_0.yml. Comment out these in production.
- kafka.*::StdDev|Mean|Min|Max # kafka-2_0_0.yml does not expose these metrics
- kafka.server:type=socket-server-metrics|controller-channel-metrics|group-coordinator-metrics|txn-marker-channel-metrics|transaction-coordinator-metrics|Fetch|Produce|Request|app-info|kafka-metrics-count
skip: true
- pattern: 'kafka.*::Value'
transform: |
kafka(in, (String) in.keyProperties.get("name"))
.type("gauge")
.transform(in.value, in.attributeType, out, V1.lowerCase()).done();
- pattern: 'kafka.*:name=(?<name>.+?)(PerSec)?:Count'
condition: mbeanInfo.getClassName().endsWith("JmxReporter$Meter")
transform: |
kafka(in, (String) match.get("name"))
.type("counter")
.suffix("total")
.transform(in.value, in.attributeType, out, V1.lowerCase()).done();
- pattern: 'kafka.*::Count'
condition: mbeanInfo.getClassName().endsWith("JmxReporter$Histogram") || mbeanInfo.getClassName().endsWith("JmxReporter$Timer")
transform: |
kafka(in, (String) in.keyProperties.get("name"))
.suffix("count")
.type("summary")
.transform(in.value, in.attributeType, out, V1.lowerCase()).done();
- pattern: 'kafka.*::(?<p>[0-9]+)thPercentile'
condition: mbeanInfo.getClassName().endsWith("JmxReporter$Histogram") || mbeanInfo.getClassName().endsWith("JmxReporter$Timer")
transform: |
kafka(in, (String) in.keyProperties.get("name"))
.addLabel("quantile", "0." + match.get("p"))
.type("summary")
.transform(in.value, in.attributeType, out, V1.lowerCase()).done();
- pattern: 'kafka.*'
transform: |
log("unhandled attribute: %s", in);
V1.transform(in, out, "type", "name", V1.lowerCase());
- transform: |
V1.transform(in, out, "type", V1.snakeCase());