Skip to content

Commit

Permalink
ENTMQBR-2557 Enable new metrics plugin for broker in container image
Browse files Browse the repository at this point in the history
also fixed a typo in amq-broker-74-persistence-clustered.yaml

(cherry picked from commit d3843cd)
  • Loading branch information
howardgao authored and Roddie Kieley committed Aug 22, 2019
1 parent fffc184 commit 3139fb7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 2 deletions.
11 changes: 11 additions & 0 deletions modules/amq-launch/added/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ function configureJAVA_ARGSMemory() {
sed -i "s/\-Xms[0-9]*[mMgG] \-Xmx[0-9]*[mMgG] \-Dhawtio/\ -Dhawtio/g" ${instanceDir}/etc/artemis.profile
}

function injectMetricsPlugin() {
instanceDir=$1
echo "Adding artemis metrics plugin"
sed -i "s/^\([[:blank:]]*\)<\\/core>/\1\1<metrics-plugin class-name=\"org.apache.activemq.artemis.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin\"\\/>\\n\1<\\/core>/" $instanceDir/etc/broker.xml
}

function configure() {
instanceDir=$1
Expand Down Expand Up @@ -317,6 +322,12 @@ function configure() {
configureLogging ${instanceDir}
configureJAVA_ARGSMemory ${instanceDir}

if [ "$AMQ_ENABLE_METRICS_PLUGIN" = "true" ]; then
echo "Enable artemis metrics plugin"
injectMetricsPlugin ${instanceDir}
injectMetricsWar ${instanceDir}
fi

$AMQ_HOME/bin/configure_s2i_files.sh ${instanceDir}
$AMQ_HOME/bin/configure_custom_config.sh ${instanceDir}
fi
Expand Down
6 changes: 6 additions & 0 deletions templates/amq-broker-75-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ objects:
value: ${AMQ_ANYCAST_PREFIX}
- name: AMQ_MULTICAST_PREFIX
value: ${AMQ_MULTICAST_PREFIX}
- name: AMQ_ENABLE_METRICS_PLUGIN
value: ${AMQ_ENABLE_METRICS_PLUGIN}
image: ${IMAGE}
imagePullPolicy: Always
readinessProbe:
Expand Down Expand Up @@ -259,3 +261,7 @@ parameters:
name: AMQ_CREDENTIAL_SECRET
required: true
value: amq-credential-secret
- description: Whether to enable artemis metrics plugin
displayName: Enable Metrics Plugin
name: AMQ_ENABLE_METRICS_PLUGIN
required: false
8 changes: 7 additions & 1 deletion templates/amq-broker-75-persistence-clustered-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,15 @@ objects:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: AMQ_ENABLE_METRICS_PLUGIN
value: ${AMQ_ENABLE_METRICS_PLUGIN}
readinessProbe:
exec:
command:
- "/bin/bash"
- "-c"
- "/opt/amq/bin/readinessProbe.sh"
image: ${IMAGE}
image: ${IMAGE}
name: ${APPLICATION_NAME}-amq
ports:
- containerPort: 8161
Expand Down Expand Up @@ -567,3 +569,7 @@ parameters:
name: IMAGE
required: true
value: registry.redhat.io/amq7/amq-broker:7.5
- description: Whether to enable artemis metrics plugin
displayName: Enable Metrics Plugin
name: AMQ_ENABLE_METRICS_PLUGIN
required: false
8 changes: 7 additions & 1 deletion templates/amq-broker-75-persistence-clustered.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ objects:
- name: AMQ_PASSWORD
valueFrom:
secretKeyRef:
name: ${}AMQ_CREDENTIAL_SECRET
name: ${AMQ_CREDENTIAL_SECRET}
key: ${AMQ_PASSWORD}
- name: AMQ_ROLE
value: ${AMQ_ROLE}
Expand Down Expand Up @@ -346,6 +346,8 @@ objects:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: AMQ_ENABLE_METRICS_PLUGIN
value: ${AMQ_ENABLE_METRICS_PLUGIN}
readinessProbe:
exec:
command:
Expand Down Expand Up @@ -485,3 +487,7 @@ parameters:
name: AMQ_CREDENTIAL_SECRET
required: true
value: amq-credential-secret
- description: Whether to enable artemis metrics plugin
displayName: Enable Metrics Plugin
name: AMQ_ENABLE_METRICS_PLUGIN
required: false
6 changes: 6 additions & 0 deletions templates/amq-broker-75-persistence-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ objects:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: AMQ_ENABLE_METRICS_PLUGIN
value: ${AMQ_ENABLE_METRICS_PLUGIN}
image: ${IMAGE}
readinessProbe:
exec:
Expand Down Expand Up @@ -341,3 +343,7 @@ parameters:
name: IMAGE
required: true
value: registry.redhat.io/amq7/amq-broker:7.5
- description: Whether to enable artemis metrics plugin
displayName: Enable Metrics Plugin
name: AMQ_ENABLE_METRICS_PLUGIN
required: false
6 changes: 6 additions & 0 deletions templates/amq-broker-75-persistence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ objects:
value: ${AMQ_ANYCAST_PREFIX}
- name: AMQ_MULTICAST_PREFIX
value: ${AMQ_MULTICAST_PREFIX}
- name: AMQ_ENABLE_METRICS_PLUGIN
value: ${AMQ_ENABLE_METRICS_PLUGIN}
image: ${IMAGE}
readinessProbe:
exec:
Expand Down Expand Up @@ -253,3 +255,7 @@ parameters:
name: AMQ_CREDENTIAL_SECRET
required: true
value: amq-credential-secret
- description: Whether to enable artemis metrics plugin
displayName: Enable Metrics Plugin
name: AMQ_ENABLE_METRICS_PLUGIN
required: false
6 changes: 6 additions & 0 deletions templates/amq-broker-75-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ objects:
value: ${AMQ_ANYCAST_PREFIX}
- name: AMQ_MULTICAST_PREFIX
value: ${AMQ_MULTICAST_PREFIX}
- name: AMQ_ENABLE_METRICS_PLUGIN
value: ${AMQ_ENABLE_METRICS_PLUGIN}
image: ${IMAGE}
imagePullPolicy: Always
readinessProbe:
Expand Down Expand Up @@ -391,3 +393,7 @@ parameters:
name: IMAGE
required: true
value: registry.redhat.io/amq7/amq-broker:7.5
- description: Whether to enable artemis metrics plugin
displayName: Enable Metrics Plugin
name: AMQ_ENABLE_METRICS_PLUGIN
required: false

0 comments on commit 3139fb7

Please sign in to comment.