Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
robsunday committed Oct 18, 2024
1 parent 5b046cb commit 36bc5aa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ protected GenericContainer<?> createTargetContainer(int jmxPort) {
builder -> builder.from("apache/activemq-classic:5.18.6").build()))
.withEnv("LOCAL_JMX", "no")
.withCopyFileToContainer(
// Overwrite default ActiveMQ configuration in order to let ActiveMQ use JMX options
// stored in $ACTIVEMQ_JMX_OPTS env variable defined below
MountableFile.forClasspathResource("activemq/env"), "/opt/apache-activemq/bin/env")
.withEnv(
"ACTIVEMQ_JMX_OPTS",
Expand Down
14 changes: 14 additions & 0 deletions jmx-scraper/src/main/resources/activemq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ rules:
mapping:
ProducerCount:
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"
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"
type: updowncounter
desc: The number of consumers currently reading from the broker.
Expand All @@ -25,21 +29,29 @@ rules:
desc: The percentage of configured memory used.
QueueSize:
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"
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"
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"
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"
type: counter
desc: The total number of messages delivered to consumers.
Expand All @@ -61,6 +73,8 @@ rules:
CurrentConnectionsCount:
metric: connection.count
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"
desc: The total number of current connections.
StorePercentUsage:
Expand Down
4 changes: 3 additions & 1 deletion jmx-scraper/src/main/resources/activemq/env
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,6 @@
# (set JAVACMD to "auto" for automatic detection)
#JAVA_HOME=""
JAVACMD="auto"
ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS $ACTIVEMQ_JMX_OPTS -Dhawtio.authenticationEnabled=false -Dhawtio.realm=activemq -Dhawtio.role=admins -Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal"

# Use JMX options defined in environment variable
ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS $ACTIVEMQ_JMX_OPTS"

0 comments on commit 36bc5aa

Please sign in to comment.