From 0b9d136c293b25ac8f9ffa6901414a1edda002bc Mon Sep 17 00:00:00 2001 From: Jeffrey Chien Date: Fri, 14 Jun 2024 17:10:05 -0400 Subject: [PATCH 1/4] Add configuration for JMX metrics. --- .../jmx-metrics/src/main/resources/README.md | 7 + .../resources/jmx/rules/kafka-consumer.yaml | 51 ++++ .../resources/jmx/rules/kafka-producer.yaml | 61 +++++ .../src/main/resources/jmx/rules/kafka.yaml | 234 ++++++++++++++++++ .../src/main/resources/jmx/rules/tomcat.yaml | 128 ++++++++++ .../src/main/resources/jmx/view.yaml | 8 + 6 files changed, 489 insertions(+) create mode 100644 instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml create mode 100644 instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml create mode 100644 instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka.yaml create mode 100644 instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml create mode 100644 instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml diff --git a/instrumentation/jmx-metrics/src/main/resources/README.md b/instrumentation/jmx-metrics/src/main/resources/README.md index 4c4d72cc38..99ddf9d7be 100644 --- a/instrumentation/jmx-metrics/src/main/resources/README.md +++ b/instrumentation/jmx-metrics/src/main/resources/README.md @@ -4,6 +4,13 @@ instrumentation support the same metrics as the [JMX Metric Gatherer](https://gi It is required at least until [open-telemetry/opentelemetry-java-instrumentation#9765](https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/9765) is addressed. +### view.yaml +A [Metric View](https://opentelemetry.io/docs/specs/otel/metrics/sdk/#view) is functionality the OpenTelemetry SDK +supports that allows users to customize the metrics outputted by the SDK. The SDK also supports [configuring views +via YAML](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/incubator#view-file-configuration), +which can be specified via property or environment variable. In this case, the view is configured to only retain metrics +from the JMX Metric Insight instrumentation. + ``` OTEL_EXPERIMENTAL_METRICS_VIEW_CONFIG: classpath:/jmx/view.yaml ``` diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml new file mode 100644 index 0000000000..e83e358cec --- /dev/null +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml @@ -0,0 +1,51 @@ +--- +rules: + - bean: kafka.consumer:client-id=*,type=consumer-fetch-manager-metrics + metricAttribute: + client-id: param(client-id) + mapping: + fetch-rate: + metric: kafka.consumer.fetch-rate + type: gauge + desc: The number of fetch requests for all topics per second + unit: "1" + records-lag-max: + metric: kafka.consumer.records-lag-max + type: gauge + desc: Number of messages the consumer lags behind the producer + unit: "1" + bytes-consumed-rate: + metric: kafka.consumer.total.bytes-consumed-rate + type: gauge + desc: The average number of bytes consumed for all topics per second + unit: by + fetch-size-avg: + metric: kafka.consumer.total.fetch-size-avg + type: gauge + desc: The average number of bytes fetched per request for all topics + unit: by + records-consumed-rate: + metric: kafka.consumer.total.records-consumed-rate + type: gauge + desc: The average number of records consumed for all topics per second + unit: "1" + - bean: kafka.consumer:client-id=*,topic=*,type=consumer-fetch-manager-metrics + metricAttribute: + client-id: param(client-id) + topic: param(topic) + mapping: + bytes-consumed-rate: + metric: kafka.consumer.bytes-consumed-rate + type: gauge + desc: The average number of bytes consumed per second + unit: by + fetch-size-avg: + metric: kafka.consumer.fetch-size-avg + type: gauge + desc: The average number of bytes fetched per request + unit: by + records-consumed-rate: + metric: kafka.consumer.records-consumed-rate + type: gauge + desc: The average number of records consumed per second + unit: "1" diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml new file mode 100644 index 0000000000..20153514a0 --- /dev/null +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml @@ -0,0 +1,61 @@ +--- +rules: + - bean: kafka.producer:client-id=*,type=producer-metrics + metricAttribute: + client-id: param(client-id) + mapping: + io-wait-time-ns-avg: + metric: kafka.producer.io-wait-time-ns-avg + type: gauge + desc: The average length of time the I/O thread spent waiting for a socket ready for reads or writes + unit: ns + outgoing-byte-rate: + metric: kafka.producer.outgoing-byte-rate + type: gauge + desc: The average number of outgoing bytes sent per second to all servers + unit: by + request-latency-avg: + metric: kafka.producer.request-latency-avg + type: gauge + desc: The average request latency + unit: ms + request-rate: + metric: kafka-producer.request-rate + type: gauge + desc: The average number of requests sent per second + unit: "1" + response-rate: + metric: kafka.producer.response-rate + type: gauge + desc: Responses received per second + unit: "1" + - bean: kafka.producer:client-id=*,topic=*,type=producer-topic-metrics + metricAttribute: + client-id: param(client-id) + topic: param(topic) + mapping: + byte-rate: + metric: kafka.producer.byte-rate + type: gauge + desc: The average number of bytes sent per second for a topic + unit: by + compression-rate: + metric: kafka.producer.compression-rate + type: gauge + desc: The average compression rate of record batches for a topic + unit: "1" + record-error-rate: + metric: kafka.producer.record-error-rate + type: gauge + desc: The average per-second number of record sends that resulted in errors for a topic + unit: "1" + record-retry-rate: + metric: kafka.producer.record-retry-rate + type: gauge + desc: The average per-second number of retried record sends for a topic + unit: "1" + record-send-rate: + metric: kafka.producer.record-send-rate + type: gauge + desc: The average number of records sent per second for a topic + unit: "1" diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka.yaml new file mode 100644 index 0000000000..5da5d93d11 --- /dev/null +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka.yaml @@ -0,0 +1,234 @@ +--- +rules: + - bean: kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec + mapping: + Count: + metric: kafka.message.count + type: counter + desc: The number of messages received by the broker + unit: "{messages}" + - bean: kafka.server:type=BrokerTopicMetrics,name=TotalProduceRequestsPerSec + metricAttribute: + type: const(produce) + mapping: + Count: + metric: kafka.request.count + type: counter + desc: The number of requests received by the broker + unit: "{requests}" + - bean: kafka.server:type=BrokerTopicMetrics,name=TotalFetchRequestsPerSec + metricAttribute: + type: const(fetch) + mapping: + Count: + metric: kafka.request.count + type: counter + desc: The number of requests received by the broker + unit: "{requests}" + - bean: kafka.server:type=BrokerTopicMetrics,name=FailedProduceRequestsPerSec + metricAttribute: + type: const(produce) + mapping: + Count: + metric: kafka.request.failed + type: counter + desc: The number of requests to the broker resulting in a failure + unit: "{requests}" + - bean: kafka.server:type=BrokerTopicMetrics,name=FailedFetchRequestsPerSec + metricAttribute: + type: const(fetch) + mapping: + Count: + metric: kafka.request.failed + type: counter + desc: The number of requests to the broker resulting in a failure + unit: "{requests}" + - bean: kafka.network:type=RequestMetrics,name=TotalTimeMs,request=Produce + metricAttribute: + type: const(produce) + unit: ms + mapping: + Count: + metric: kafka.request.time.total + type: counter + desc: The total time the broker has taken to service requests + 50thPercentile: + metric: kafka.request.time.50p + type: gauge + desc: The 50th percentile time the broker has taken to service requests + 99thPercentile: + metric: kafka.request.time.99p + type: gauge + desc: The 99th percentile time the broker has taken to service requests + Mean: + metric: kafka.request.time.avg + type: gauge + desc: The average time the broker has taken to service requests + - bean: kafka.network:type=RequestMetrics,name=TotalTimeMs,request=FetchConsumer + metricAttribute: + type: const(fetchconsumer) + unit: ms + mapping: + Count: + metric: kafka.request.time.total + type: counter + desc: The total time the broker has taken to service requests + 50thPercentile: + metric: kafka.request.time.50p + type: gauge + desc: The 50th percentile time the broker has taken to service requests + 99thPercentile: + metric: kafka.request.time.99p + type: gauge + desc: The 99th percentile time the broker has taken to service requests + Mean: + metric: kafka.request.time.avg + type: gauge + desc: The average time the broker has taken to service requests + - bean: kafka.network:type=RequestMetrics,name=TotalTimeMs,request=FetchFollower + metricAttribute: + type: const(fetchfollower) + unit: ms + mapping: + Count: + metric: kafka.request.time.total + type: counter + desc: The total time the broker has taken to service requests + 50thPercentile: + metric: kafka.request.time.50p + type: gauge + desc: The 50th percentile time the broker has taken to service requests + 99thPercentile: + metric: kafka.request.time.99p + type: gauge + desc: The 99th percentile time the broker has taken to service requests + Mean: + metric: kafka.request.time.avg + type: gauge + desc: The average time the broker has taken to service requests + - bean: kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec + metricAttribute: + direction: const(in) + mapping: + Count: + metric: kafka.network.io + type: counter + desc: The bytes received or sent by the broker + unit: by + - bean: kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec + metricAttribute: + direction: const(out) + mapping: + Count: + metric: kafka.network.io + type: counter + desc: The bytes received or sent by the broker + unit: by + - bean: kafka.server:type=DelayedOperationPurgatory,name=PurgatorySize,delayedOperation=Produce + metricAttribute: + type: const(produce) + mapping: + Value: + metric: kafka.purgatory.size + type: gauge + desc: The number of requests waiting in purgatory + unit: "{requests}" + - bean: kafka.server:type=DelayedOperationPurgatory,name=PurgatorySize,delayedOperation=Fetch + metricAttribute: + type: const(fetch) + mapping: + Value: + metric: kafka.purgatory.size + type: gauge + desc: The number of requests waiting in purgatory + unit: "{requests}" + - bean: kafka.server:type=ReplicaManager,name=PartitionCount + mapping: + Value: + metric: kafka.partition.count + type: gauge + desc: The number of partitions on the broker + unit: "{partitions}" + - bean: kafka.controller:type=KafkaController,name=OfflinePartitionsCount + mapping: + Value: + metric: kafka.partition.offline + type: gauge + desc: The number of partitions offline + unit: "{partitions}" + - bean: kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions + mapping: + Value: + metric: kafka.partition.under_replicated + type: gauge + desc: The number of under replicated partitions + unit: "{partitions}" + - bean: kafka.server:type=ReplicaManager,name=IsrShrinksPerSec + metricAttribute: + operation: const(shrink) + mapping: + Count: + metric: kafka.isr.operation.count + type: counter + desc: The number of in-sync replica shrink and expand operations + unit: "{operations}" + - bean: kafka.server:type=ReplicaManager,name=IsrExpandsPerSec + metricAttribute: + operation: const(expand) + mapping: + Count: + metric: kafka.isr.operation.count + type: counter + desc: The number of in-sync replica shrink and expand operations + unit: "{operations}" + - bean: kafka.server:type=ReplicaFetcherManager,name=MaxLag,clientId=Replica + mapping: + Value: + metric: kafka.max.lag + type: gauge + desc: max lag in messages between follower and leader replicas + unit: "{messages}" + - bean: kafka.controller:type=KafkaController,name=ActiveControllerCount + mapping: + Value: + metric: kafka.controller.active.count + type: gauge + desc: controller is active on broker + unit: "{controllers}" + - bean: kafka.controller:type=ControllerStats,name=LeaderElectionRateAndTimeMs + mapping: + Count: + metric: kafka.leader.election.rate + type: counter + desc: leader election rate - increasing indicates broker failures + unit: "{elections}" + - bean: kafka.controller:type=ControllerStats,name=UncleanLeaderElectionsPerSec + mapping: + Count: + metric: kafka.unclean.election.rate + type: counter + desc: unclean leader election rate - increasing indicates broker failures + unit: "{elections}" + - bean: kafka.network:type=RequestChannel,name=RequestQueueSize + mapping: + Value: + metric: kafka.request.queue + type: gauge + desc: size of the request queue + unit: "{requests}" + - bean: kafka.log:type=LogFlushStats,name=LogFlushRateAndTimeMs + unit: ms + prefix: kafka.logs.flush.time. + mapping: + Count: + metric: count + type: counter + desc: log flush count + 50thPercentile: + metric: median + type: gauge + desc: log flush time - 50th percentile + 99thPercentile: + metric: 99p + type: gauge + desc: log flush time - 99th percentile diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml new file mode 100644 index 0000000000..b5e2bd0dd6 --- /dev/null +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml @@ -0,0 +1,128 @@ +--- +rules: + - bean: Catalina:type=Manager,host=localhost,context=* + mapping: + activeSessions: + metric: tomcat.sessions + type: gauge + unit: sessions + desc: The number of active sessions. + - bean: Catalina:type=GlobalRequestProcessor,name=* + metricAttribute: + name: param(name) + mapping: + errorCount: + metric: tomcat.errors + type: counter + unit: errors + desc: The number of errors encountered. + requestCount: + metric: tomcat.request_count + type: counter + unit: requests + desc: The total requests. + maxTime: + metric: tomcat.max_time + type: gauge + unit: ms + desc: Maximum time to process a request + processingTime: + metric: tomcat.processing_time + type: counter + unit: ms + desc: The total processing time. + bytesReceived: + metric: tomcat.traffic + metricAttribute: + direction: const(received) + type: counter + unit: by + desc: The number of bytes transmitted and received. + bytesSent: + metric: tomcat.traffic + metricAttribute: + direction: const(sent) + type: counter + unit: by + desc: The number of bytes transmitted and received. + - bean: Catalina:type=ThreadPool,name=* + metricAttribute: + name: param(name) + mapping: + currentThreadCount: + metric: tomcat.threads + metricAttribute: + state: const(idle) + type: gauge + unit: threads + desc: The number of threads + currentThreadsBusy: + metric: tomcat.threads + metricAttribute: + state: const(busy) + type: gauge + unit: threads + desc: The number of threads + - bean: Tomcat:type=Manager,host=localhost,context=* + mapping: + activeSessions: + metric: tomcat.sessions + type: gauge + unit: sessions + desc: The number of active sessions. + - bean: Tomcat:type=GlobalRequestProcessor,name=* + metricAttribute: + name: param(name) + mapping: + errorCount: + metric: tomcat.errors + type: counter + unit: errors + desc: The number of errors encountered. + requestCount: + metric: tomcat.request_count + type: counter + unit: requests + desc: The total requests. + maxTime: + metric: tomcat.max_time + type: gauge + unit: ms + desc: Maximum time to process a request + processingTime: + metric: tomcat.processing_time + type: counter + unit: ms + desc: The total processing time. + bytesReceived: + metric: tomcat.traffic + metricAttribute: + direction: const(received) + type: counter + unit: by + desc: The number of bytes transmitted and received. + bytesSent: + metric: tomcat.traffic + metricAttribute: + direction: const(sent) + type: counter + unit: by + desc: The number of bytes transmitted and received. + - bean: Tomcat:type=ThreadPool,name=* + metricAttribute: + name: param(name) + mapping: + currentThreadCount: + metric: tomcat.threads + metricAttribute: + state: const(idle) + type: gauge + unit: threads + desc: The number of threads + currentThreadsBusy: + metric: tomcat.threads + metricAttribute: + state: const(busy) + type: gauge + unit: threads + desc: The number of threads diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml new file mode 100644 index 0000000000..099ab71572 --- /dev/null +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml @@ -0,0 +1,8 @@ +- selector: + meter_name: io.opentelemetry.jmx + view: + aggregation: default +- selector: + instrument_name: "*" + view: + aggregation: drop From f5cc0aee483cbc42bd777760645e135b4ba708bd Mon Sep 17 00:00:00 2001 From: Jeffrey Chien Date: Wed, 28 Aug 2024 19:17:27 -0400 Subject: [PATCH 2/4] Fix JVM composite bean definitions. --- .../src/main/resources/jmx/rules/jvm.yaml | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml index b2c29cfbc2..59622e2472 100644 --- a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml @@ -27,12 +27,30 @@ rules: prefix: jvm.memory. type: gauge mapping: + HeapMemoryUsage.init: + metric: heap.init + desc: The initial amount of memory that the JVM requests from the operating system for the heap HeapMemoryUsage.used: metric: heap.used desc: The current heap usage + HeapMemoryUsage.committed: + metric: heap.committed + desc: The amount of memory that is guaranteed to be available for the heap + HeapMemoryUsage.max: + metric: heap.max + desc: The maximum amount of memory can be used for the heap + NonHeapMemoryUsage.init: + metric: nonheap.init + desc: The initial amount of memory that the JVM requests from the operating system for non-heap purposes NonHeapMemoryUsage.used: metric: nonheap.used - desc: The current non-heap usage + desc: The current non-heap memory usage + NonHeapMemoryUsage.committed: + metric: nonheap.committed + desc: The amount of memory that is guaranteed to be available for non-heap purposes + NonHeapMemoryUsage.max: + metric: nonheap.max + desc: The maximum amount of memory can be used for non-heap purposes - bean: java.lang:type=MemoryPool,* unit: by prefix: jvm.memory.pool. @@ -43,9 +61,18 @@ rules: CollectionUsage.used: metric: used_after_last_gc desc: Memory used after the most recent gc event + Usage.init: + metric: init + desc: The initial amount of memory that the JVM requests from the operating system for the memory pool Usage.used: metric: used - desc: Current memory pool used + desc: The current memory pool memory usage + Usage.committed: + metric: committed + desc: The amount of memory that is guaranteed to be available for the memory pool + Usage.max: + metric: max + desc: The maximum amount of memory can be used for the memory pool - bean: java.lang:type=Threading unit: "1" prefix: jvm.threads. From cfb7fe523888d6e53ceb262f167fe045c0ad560e Mon Sep 17 00:00:00 2001 From: Jeffrey Chien Date: Tue, 1 Oct 2024 15:31:18 -0400 Subject: [PATCH 3/4] Remove metric view configuration. --- instrumentation/jmx-metrics/src/main/resources/README.md | 7 ------- .../jmx-metrics/src/main/resources/jmx/view.yaml | 8 -------- 2 files changed, 15 deletions(-) delete mode 100644 instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml diff --git a/instrumentation/jmx-metrics/src/main/resources/README.md b/instrumentation/jmx-metrics/src/main/resources/README.md index 99ddf9d7be..4c4d72cc38 100644 --- a/instrumentation/jmx-metrics/src/main/resources/README.md +++ b/instrumentation/jmx-metrics/src/main/resources/README.md @@ -4,13 +4,6 @@ instrumentation support the same metrics as the [JMX Metric Gatherer](https://gi It is required at least until [open-telemetry/opentelemetry-java-instrumentation#9765](https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/9765) is addressed. -### view.yaml -A [Metric View](https://opentelemetry.io/docs/specs/otel/metrics/sdk/#view) is functionality the OpenTelemetry SDK -supports that allows users to customize the metrics outputted by the SDK. The SDK also supports [configuring views -via YAML](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/incubator#view-file-configuration), -which can be specified via property or environment variable. In this case, the view is configured to only retain metrics -from the JMX Metric Insight instrumentation. - ``` OTEL_EXPERIMENTAL_METRICS_VIEW_CONFIG: classpath:/jmx/view.yaml ``` diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml deleted file mode 100644 index 099ab71572..0000000000 --- a/instrumentation/jmx-metrics/src/main/resources/jmx/view.yaml +++ /dev/null @@ -1,8 +0,0 @@ -- selector: - meter_name: io.opentelemetry.jmx - view: - aggregation: default -- selector: - instrument_name: "*" - view: - aggregation: drop From b019ddf18f3839d7e4d01b8f16be2d28d10c0d74 Mon Sep 17 00:00:00 2001 From: Jeffrey Chien Date: Fri, 4 Oct 2024 17:41:24 -0400 Subject: [PATCH 4/4] Clean up metric definitions. --- .../jmx-metrics/src/main/resources/jmx/rules/jvm.yaml | 6 +++--- .../src/main/resources/jmx/rules/kafka-consumer.yaml | 4 ++-- .../src/main/resources/jmx/rules/kafka-producer.yaml | 4 ++-- .../jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml | 4 ++++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml index 59622e2472..6f3606e5a8 100644 --- a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/jvm.yaml @@ -8,7 +8,7 @@ rules: LoadedClassCount: metric: loaded desc: Number of loaded classes - - bean: java.lang:type=GarbageCollector,* + - bean: java.lang:type=GarbageCollector,name=* prefix: jvm.gc.collections. type: counter metricAttribute: @@ -51,7 +51,7 @@ rules: NonHeapMemoryUsage.max: metric: nonheap.max desc: The maximum amount of memory can be used for non-heap purposes - - bean: java.lang:type=MemoryPool,* + - bean: java.lang:type=MemoryPool,name=* unit: by prefix: jvm.memory.pool. type: gauge @@ -81,7 +81,7 @@ rules: ThreadCount: metric: count desc: Number of threads - - bean: java.lang:type=OperatingSystem,* + - bean: java.lang:type=OperatingSystem prefix: jvm.cpu. type: gauge mapping: diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml index e83e358cec..c3d2860b90 100644 --- a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-consumer.yaml @@ -1,6 +1,6 @@ --- rules: - - bean: kafka.consumer:client-id=*,type=consumer-fetch-manager-metrics + - bean: kafka.consumer:type=consumer-fetch-manager-metrics,client-id=* metricAttribute: client-id: param(client-id) mapping: @@ -29,7 +29,7 @@ rules: type: gauge desc: The average number of records consumed for all topics per second unit: "1" - - bean: kafka.consumer:client-id=*,topic=*,type=consumer-fetch-manager-metrics + - bean: kafka.consumer:type=consumer-fetch-manager-metrics,client-id=*,topic=* metricAttribute: client-id: param(client-id) topic: param(topic) diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml index 20153514a0..dbbd95f7ae 100644 --- a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/kafka-producer.yaml @@ -1,6 +1,6 @@ --- rules: - - bean: kafka.producer:client-id=*,type=producer-metrics + - bean: kafka.producer:type=producer-metrics,client-id=* metricAttribute: client-id: param(client-id) mapping: @@ -29,7 +29,7 @@ rules: type: gauge desc: Responses received per second unit: "1" - - bean: kafka.producer:client-id=*,topic=*,type=producer-topic-metrics + - bean: kafka.producer:type=producer-topic-metrics,client-id=*,topic=* metricAttribute: client-id: param(client-id) topic: param(topic) diff --git a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml index b5e2bd0dd6..0d7fa1602f 100644 --- a/instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml +++ b/instrumentation/jmx-metrics/src/main/resources/jmx/rules/tomcat.yaml @@ -1,6 +1,8 @@ --- rules: - bean: Catalina:type=Manager,host=localhost,context=* + metricAttribute: + context: param(context) mapping: activeSessions: metric: tomcat.sessions @@ -64,6 +66,8 @@ rules: unit: threads desc: The number of threads - bean: Tomcat:type=Manager,host=localhost,context=* + metricAttribute: + context: param(context) mapping: activeSessions: metric: tomcat.sessions