Skip to content

Commit

Permalink
[#976] Add an example to monitor broker metrics by using Prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
brusdev committed Jul 18, 2024
1 parent f407dbc commit f4f5dec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docs/help/operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -993,14 +993,12 @@ In addition, you need to expose the console, for example
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: ex-aao
name: artemis-with-metrics
spec:
deploymentPlan:
size: 1
enableMetricsPlugin: true
image: placeholder
console:
expose: true
deploymentPlan:
enableMetricsPlugin: true
```

### Enable JVM metrics
Expand All @@ -1011,12 +1009,11 @@ JVM memory metrics are enabled by default. Use the `spec.brokerProperties` field
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: artemis-jvm
name: artemis-with-metrics
spec:
console:
expose: true
deploymentPlan:
size: 1
enableMetricsPlugin: true
brokerProperties:
- "metricsConfiguration.jvmGc=true"
Expand All @@ -1026,22 +1023,22 @@ spec:

### Monitor broker metrics by using Prometheus

The operator will expose a containerPort named **wsconj** for the Prometheus to monitor. The following
The operator will expose a port named **console-jolokia** for the Prometheus to monitor. The following
is a sample Prometheus ServiceMonitor resource

```yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: example-app
name: artemis-with-metrics-monitor
labels:
team: prometheus
spec:
selector:
matchLabels:
application: ex-aao-app
application: artemis-with-metrics-app
endpoints:
- port: wconsj
- port: console-jolokia
```
For a complete example please refer to this [artemiscloud example](https://github.com/artemiscloud/artemiscloud-examples/tree/main/operator/prometheus).

Expand Down
19 changes: 19 additions & 0 deletions examples/artemis/artemis_metrics_monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: artemis-with-metrics
spec:
deploymentPlan:
enableMetricsPlugin: true
size: 2
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: artemis-with-metrics-monitor
spec:
selector:
matchLabels:
application: artemis-with-metrics-app
endpoints:
- port: console-jolokia

0 comments on commit f4f5dec

Please sign in to comment.