Skip to content

Commit 857e4ae

Browse files
authored
JMX Scraper - Invalid ActiveMQ units fixed (#1553)
1 parent 41a07af commit 857e4ae

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

jmx-metrics/src/integrationTest/java/io/opentelemetry/contrib/jmxmetrics/target_systems/ActivemqIntegrationTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void endToEnd() {
4343
metric,
4444
"activemq.consumer.count",
4545
"The number of consumers currently reading from the broker.",
46-
"consumers",
46+
"{consumer}",
4747
attrs ->
4848
attrs.containsOnly(
4949
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -53,7 +53,7 @@ void endToEnd() {
5353
metric,
5454
"activemq.producer.count",
5555
"The number of producers currently attached to the broker.",
56-
"producers",
56+
"{producer}",
5757
attrs ->
5858
attrs.containsOnly(
5959
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -63,7 +63,7 @@ void endToEnd() {
6363
metric,
6464
"activemq.connection.count",
6565
"The total number of current connections.",
66-
"connections",
66+
"{connection}",
6767
/* isMonotonic= */ false),
6868
metric ->
6969
assertGaugeWithAttributes(
@@ -92,7 +92,7 @@ void endToEnd() {
9292
metric,
9393
"activemq.message.current",
9494
"The current number of messages waiting to be consumed.",
95-
"messages",
95+
"{message}",
9696
attrs ->
9797
attrs.containsOnly(
9898
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -102,7 +102,7 @@ void endToEnd() {
102102
metric,
103103
"activemq.message.current",
104104
"The current number of messages waiting to be consumed.",
105-
"messages",
105+
"{message}",
106106
attrs ->
107107
attrs.containsOnly(
108108
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -112,7 +112,7 @@ void endToEnd() {
112112
metric,
113113
"activemq.message.expired",
114114
"The total number of messages not delivered because they expired.",
115-
"messages",
115+
"{message}",
116116
attrs ->
117117
attrs.containsOnly(
118118
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -122,7 +122,7 @@ void endToEnd() {
122122
metric,
123123
"activemq.message.enqueued",
124124
"The total number of messages received by the broker.",
125-
"messages",
125+
"{message}",
126126
attrs ->
127127
attrs.containsOnly(
128128
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -132,7 +132,7 @@ void endToEnd() {
132132
metric,
133133
"activemq.message.dequeued",
134134
"The total number of messages delivered to consumers.",
135-
"messages",
135+
"{message}",
136136
attrs ->
137137
attrs.containsOnly(
138138
entry("destination", "ActiveMQ.Advisory.MasterBroker"),

jmx-metrics/src/main/resources/target-systems/activemq.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def activemqMetrics = otel.mbeans(
2626
otel.instrument(activemqMetrics,
2727
"activemq.producer.count",
2828
"The number of producers currently attached to the broker.",
29-
"producers",
29+
"{producer}",
3030
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName")},
3131
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
3232
"ProducerCount",
@@ -35,7 +35,7 @@ otel.instrument(activemqMetrics,
3535
otel.instrument(activemqMetrics,
3636
"activemq.consumer.count",
3737
"The number of consumers currently reading from the broker.",
38-
"consumers",
38+
"{consumer}",
3939
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
4040
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
4141
"ConsumerCount",
@@ -53,7 +53,7 @@ otel.instrument(activemqMetrics,
5353
otel.instrument(activemqMetrics,
5454
"activemq.message.current",
5555
"The current number of messages waiting to be consumed.",
56-
"messages",
56+
"{message}",
5757
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
5858
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
5959
"QueueSize",
@@ -62,7 +62,7 @@ otel.instrument(activemqMetrics,
6262
otel.instrument(activemqMetrics,
6363
"activemq.message.expired",
6464
"The total number of messages not delivered because they expired.",
65-
"messages",
65+
"{message}",
6666
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
6767
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
6868
"ExpiredCount",
@@ -71,7 +71,7 @@ otel.instrument(activemqMetrics,
7171
otel.instrument(activemqMetrics,
7272
"activemq.message.enqueued",
7373
"The total number of messages received by the broker.",
74-
"messages",
74+
"{message}",
7575
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
7676
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
7777
"EnqueueCount",
@@ -80,7 +80,7 @@ otel.instrument(activemqMetrics,
8080
otel.instrument(activemqMetrics,
8181
"activemq.message.dequeued",
8282
"The total number of messages delivered to consumers.",
83-
"messages",
83+
"{message}",
8484
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
8585
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
8686
"DequeueCount",
@@ -105,7 +105,7 @@ def activemqMetricsNoDestination = otel.mbean(
105105
otel.instrument(activemqMetricsNoDestination,
106106
"activemq.connection.count",
107107
"The total number of current connections.",
108-
"connections",
108+
"{connection}",
109109
"CurrentConnectionsCount",
110110
otel.&longUpDownCounterCallback)
111111

@@ -121,4 +121,4 @@ otel.instrument(activemqMetricsNoDestination,
121121
"The percentage of configured disk used for non-persistent messages.",
122122
"%",
123123
"TempPercentUsage",
124-
otel.&doubleValueCallback)
124+
otel.&doubleValueCallback)

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/ActiveMqIntegrationTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected void verifyMetrics() {
4646
metric,
4747
"activemq.consumer.count",
4848
"The number of consumers currently reading from the broker.",
49-
"consumers",
49+
"{consumer}",
5050
/* isMonotonic= */ false,
5151
attrs ->
5252
attrs.containsOnly(
@@ -57,7 +57,7 @@ protected void verifyMetrics() {
5757
metric,
5858
"activemq.producer.count",
5959
"The number of producers currently attached to the broker.",
60-
"producers",
60+
"{producer}",
6161
/* isMonotonic= */ false,
6262
attrs ->
6363
attrs.containsOnly(
@@ -68,7 +68,7 @@ protected void verifyMetrics() {
6868
metric,
6969
"activemq.connection.count",
7070
"The total number of current connections.",
71-
"connections",
71+
"{connection}",
7272
/* isMonotonic= */ false,
7373
attrs -> attrs.containsOnly(entry("broker", "localhost"))),
7474
metric ->
@@ -100,7 +100,7 @@ protected void verifyMetrics() {
100100
metric,
101101
"activemq.message.current",
102102
"The current number of messages waiting to be consumed.",
103-
"messages",
103+
"{message}",
104104
/* isMonotonic= */ false,
105105
attrs ->
106106
attrs.containsOnly(
@@ -111,7 +111,7 @@ protected void verifyMetrics() {
111111
metric,
112112
"activemq.message.expired",
113113
"The total number of messages not delivered because they expired.",
114-
"messages",
114+
"{message}",
115115
attrs ->
116116
attrs.containsOnly(
117117
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -121,7 +121,7 @@ protected void verifyMetrics() {
121121
metric,
122122
"activemq.message.enqueued",
123123
"The total number of messages received by the broker.",
124-
"messages",
124+
"{message}",
125125
attrs ->
126126
attrs.containsOnly(
127127
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
@@ -131,7 +131,7 @@ protected void verifyMetrics() {
131131
metric,
132132
"activemq.message.dequeued",
133133
"The total number of messages delivered to consumers.",
134-
"messages",
134+
"{message}",
135135
attrs ->
136136
attrs.containsOnly(
137137
entry("destination", "ActiveMQ.Advisory.MasterBroker"),

jmx-scraper/src/main/resources/activemq.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ rules:
1212
metric: producer.count
1313
# Unit name inherited from activemq.groovy file.
1414
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
15-
unit: "producers"
15+
unit: "{producer}"
1616
type: updowncounter
1717
desc: The number of producers currently attached to the broker.
1818
ConsumerCount:
1919
metric: consumer.count
2020
# Unit name inherited from activemq.groovy file.
2121
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
22-
unit: "consumers"
22+
unit: "{consumer}"
2323
type: updowncounter
2424
desc: The number of consumers currently reading from the broker.
2525
MemoryPercentUsage:
@@ -31,28 +31,28 @@ rules:
3131
metric: message.current
3232
# Unit name inherited from activemq.groovy file.
3333
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
34-
unit: "messages"
34+
unit: "{message}"
3535
type: updowncounter
3636
desc: The current number of messages waiting to be consumed.
3737
ExpiredCount:
3838
metric: message.expired
3939
# Unit name inherited from activemq.groovy file.
4040
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
41-
unit: "messages"
41+
unit: "{message}"
4242
type: counter
4343
desc: The total number of messages not delivered because they expired.
4444
EnqueueCount:
4545
metric: message.enqueued
4646
# Unit name inherited from activemq.groovy file.
4747
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
48-
unit: "messages"
48+
unit: "{message}"
4949
type: counter
5050
desc: The total number of messages received by the broker.
5151
DequeueCount:
5252
metric: message.dequeued
5353
# Unit name inherited from activemq.groovy file.
5454
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
55-
unit: "messages"
55+
unit: "{message}"
5656
type: counter
5757
desc: The total number of messages delivered to consumers.
5858
AverageEnqueueTime:
@@ -75,7 +75,7 @@ rules:
7575
type: updowncounter
7676
# Unit name inherited from activemq.groovy file.
7777
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
78-
unit: "connections"
78+
unit: "{connection}"
7979
desc: The total number of current connections.
8080
StorePercentUsage:
8181
metric: disk.store_usage

0 commit comments

Comments
 (0)