Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMX Scraper - Invalid ActiveMQ units fixed #1553

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void endToEnd() {
metric,
"activemq.consumer.count",
"The number of consumers currently reading from the broker.",
"consumers",
"{consumer}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -53,7 +53,7 @@ void endToEnd() {
metric,
"activemq.producer.count",
"The number of producers currently attached to the broker.",
"producers",
"{producer}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -63,7 +63,7 @@ void endToEnd() {
metric,
"activemq.connection.count",
"The total number of current connections.",
"connections",
"{connection}",
/* isMonotonic= */ false),
metric ->
assertGaugeWithAttributes(
Expand Down Expand Up @@ -92,7 +92,7 @@ void endToEnd() {
metric,
"activemq.message.current",
"The current number of messages waiting to be consumed.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -102,7 +102,7 @@ void endToEnd() {
metric,
"activemq.message.current",
"The current number of messages waiting to be consumed.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -112,7 +112,7 @@ void endToEnd() {
metric,
"activemq.message.expired",
"The total number of messages not delivered because they expired.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -122,7 +122,7 @@ void endToEnd() {
metric,
"activemq.message.enqueued",
"The total number of messages received by the broker.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -132,7 +132,7 @@ void endToEnd() {
metric,
"activemq.message.dequeued",
"The total number of messages delivered to consumers.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand Down
16 changes: 8 additions & 8 deletions jmx-metrics/src/main/resources/target-systems/activemq.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def activemqMetrics = otel.mbeans(
otel.instrument(activemqMetrics,
"activemq.producer.count",
"The number of producers currently attached to the broker.",
"producers",
"{producer}",
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName")},
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
"ProducerCount",
Expand All @@ -35,7 +35,7 @@ otel.instrument(activemqMetrics,
otel.instrument(activemqMetrics,
"activemq.consumer.count",
"The number of consumers currently reading from the broker.",
"consumers",
"{consumer}",
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
"ConsumerCount",
Expand All @@ -53,7 +53,7 @@ otel.instrument(activemqMetrics,
otel.instrument(activemqMetrics,
"activemq.message.current",
"The current number of messages waiting to be consumed.",
"messages",
"{message}",
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
"QueueSize",
Expand All @@ -62,7 +62,7 @@ otel.instrument(activemqMetrics,
otel.instrument(activemqMetrics,
"activemq.message.expired",
"The total number of messages not delivered because they expired.",
"messages",
"{message}",
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
"ExpiredCount",
Expand All @@ -71,7 +71,7 @@ otel.instrument(activemqMetrics,
otel.instrument(activemqMetrics,
"activemq.message.enqueued",
"The total number of messages received by the broker.",
"messages",
"{message}",
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
"EnqueueCount",
Expand All @@ -80,7 +80,7 @@ otel.instrument(activemqMetrics,
otel.instrument(activemqMetrics,
"activemq.message.dequeued",
"The total number of messages delivered to consumers.",
"messages",
"{message}",
["destination" : { mbean -> mbean.name().getKeyProperty("destinationName") },
"broker" : { mbean -> mbean.name().getKeyProperty("brokerName")}],
"DequeueCount",
Expand All @@ -105,7 +105,7 @@ def activemqMetricsNoDestination = otel.mbean(
otel.instrument(activemqMetricsNoDestination,
"activemq.connection.count",
"The total number of current connections.",
"connections",
"{connection}",
"CurrentConnectionsCount",
otel.&longUpDownCounterCallback)

Expand All @@ -121,4 +121,4 @@ otel.instrument(activemqMetricsNoDestination,
"The percentage of configured disk used for non-persistent messages.",
"%",
"TempPercentUsage",
otel.&doubleValueCallback)
otel.&doubleValueCallback)
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected void verifyMetrics() {
metric,
"activemq.consumer.count",
"The number of consumers currently reading from the broker.",
"consumers",
"{consumer}",
/* isMonotonic= */ false,
attrs ->
attrs.containsOnly(
Expand All @@ -57,7 +57,7 @@ protected void verifyMetrics() {
metric,
"activemq.producer.count",
"The number of producers currently attached to the broker.",
"producers",
"{producer}",
/* isMonotonic= */ false,
attrs ->
attrs.containsOnly(
Expand All @@ -68,7 +68,7 @@ protected void verifyMetrics() {
metric,
"activemq.connection.count",
"The total number of current connections.",
"connections",
"{connection}",
/* isMonotonic= */ false,
attrs -> attrs.containsOnly(entry("broker", "localhost"))),
metric ->
Expand Down Expand Up @@ -100,7 +100,7 @@ protected void verifyMetrics() {
metric,
"activemq.message.current",
"The current number of messages waiting to be consumed.",
"messages",
"{message}",
/* isMonotonic= */ false,
attrs ->
attrs.containsOnly(
Expand All @@ -111,7 +111,7 @@ protected void verifyMetrics() {
metric,
"activemq.message.expired",
"The total number of messages not delivered because they expired.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -121,7 +121,7 @@ protected void verifyMetrics() {
metric,
"activemq.message.enqueued",
"The total number of messages received by the broker.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand All @@ -131,7 +131,7 @@ protected void verifyMetrics() {
metric,
"activemq.message.dequeued",
"The total number of messages delivered to consumers.",
"messages",
"{message}",
attrs ->
attrs.containsOnly(
entry("destination", "ActiveMQ.Advisory.MasterBroker"),
Expand Down
14 changes: 7 additions & 7 deletions jmx-scraper/src/main/resources/activemq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ rules:
metric: producer.count
# Unit name inherited from activemq.groovy file.
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
unit: "producers"
unit: "{producer}"
type: updowncounter
desc: The number of producers currently attached to the broker.
ConsumerCount:
metric: consumer.count
# Unit name inherited from activemq.groovy file.
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
unit: "consumers"
unit: "{consumer}"
type: updowncounter
desc: The number of consumers currently reading from the broker.
MemoryPercentUsage:
Expand All @@ -31,28 +31,28 @@ rules:
metric: message.current
# Unit name inherited from activemq.groovy file.
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
unit: "messages"
unit: "{message}"
type: updowncounter
desc: The current number of messages waiting to be consumed.
ExpiredCount:
metric: message.expired
# Unit name inherited from activemq.groovy file.
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
unit: "messages"
unit: "{message}"
type: counter
desc: The total number of messages not delivered because they expired.
EnqueueCount:
metric: message.enqueued
# Unit name inherited from activemq.groovy file.
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
unit: "messages"
unit: "{message}"
type: counter
desc: The total number of messages received by the broker.
DequeueCount:
metric: message.dequeued
# Unit name inherited from activemq.groovy file.
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
unit: "messages"
unit: "{message}"
type: counter
desc: The total number of messages delivered to consumers.
AverageEnqueueTime:
Expand All @@ -75,7 +75,7 @@ rules:
type: updowncounter
# Unit name inherited from activemq.groovy file.
# Will be updated to {} semconv notation when we switch to use original files from JMX Insights
unit: "connections"
unit: "{connection}"
desc: The total number of current connections.
StorePercentUsage:
metric: disk.store_usage
Expand Down
Loading