-
Notifications
You must be signed in to change notification settings - Fork 5k
[Metricbeat] Implement IBM MQ module #15301
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
Changes from all commits
ddbe72a
2927d58
bcc0335
fc08998
647eaec
4783ce5
d6f5157
beecde6
3199185
f33456a
0727984
9266e67
6278515
1d8f0a8
8f41408
6715f09
7297ccd
216959d
30d63e5
d736e55
f28b213
c27a577
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| //// | ||
| This file is generated! See scripts/mage/docs_collector.go | ||
| //// | ||
|
|
||
| [[metricbeat-module-ibmmq]] | ||
| [role="xpack"] | ||
| == IBM MQ module | ||
|
|
||
| beta[] | ||
|
|
||
| This module periodically fetches metrics from a containerized distribution of IBM MQ. | ||
|
|
||
| [float] | ||
| === Compatibility | ||
|
|
||
| The ibmmq `qmgr` metricset is compatible with a containerized distribution of IBM MQ (since version 9.1.0). | ||
| The Docker image starts the `runmqserver` process, which spawns the HTTP server exposing metrics in Prometheus | ||
| format ([source code](https://github.com/ibm-messaging/mq-container/blob/9.1.0/internal/metrics/metrics.go)). | ||
|
|
||
| The Docker container lifecycle, including metrics collection, has been described in the [Internals](https://github.com/ibm-messaging/mq-container/blob/9.1.0/docs/internals.md) | ||
| document. | ||
|
|
||
| The image provides an option to easily enable metrics exporter using an environment | ||
| variable: | ||
|
|
||
| `MQ_ENABLE_METRICS` - Set this to `true` to generate Prometheus metrics for the Queue Manager. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know which versions of MQ provide the exporter? Do we know how to enable it when not using the Docker image? I'm thinking on how feasible / easy is to go this route in real world deployments (/cc @felix-lessoer @exekias )
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the questions, @andresrc . Let me respond to these:
The exporter is available only if you're using the image. It's part of the The description of the internals is available here: https://github.com/ibm-messaging/mq-container/blob/master/docs/internals.md Source (main.go) of
Not specifically MQ, but the containerized distribution of it. According to the sources, the metrics exporter has been enabled in the release version 9.1.0. Source code: https://github.com/ibm-messaging/mq-container/tree/9.1.0/internal/metrics PR: https://github.com/ibm-messaging/mq-container/pull/81/files
I think that we can leave a message here that Metricbeat only supports deployments of the official containerized distribution of the MQ. Currently it's the only way to go if we don't want to link the proprietary code. |
||
| [float] | ||
| === Dashboard | ||
|
|
||
| The ibmmq module includes predefined dashboards with overview information | ||
| of the monitored Queue Manager, including subscriptions, calls and messages. | ||
|
|
||
| image::./images/metricbeat-ibmmq-calls.png[] | ||
|
|
||
| image::./images/metricbeat-ibmmq-messages.png[] | ||
|
|
||
| image::./images/metricbeat-ibmmq-subscriptions.png[] | ||
|
|
||
|
|
||
| [float] | ||
| === Example configuration | ||
|
|
||
| The IBM MQ module supports the standard configuration options that are described | ||
| in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| metricbeat.modules: | ||
| - module: ibmmq | ||
| metricsets: ['qmgr'] | ||
| period: 10s | ||
| hosts: ['localhost:9157'] | ||
|
|
||
| # This module uses the Prometheus collector metricset, all | ||
| # the options for this metricset are also available here. | ||
| metrics_path: /metrics | ||
|
|
||
| # The custom processor is responsible for filtering Prometheus metrics | ||
| # not stricly related to the IBM MQ domain, e.g. system load, process, | ||
| # metrics HTTP server. | ||
| processors: | ||
| - script: | ||
| lang: javascript | ||
| source: > | ||
| function process(event) { | ||
| var metrics = event.Get("prometheus.metrics"); | ||
| Object.keys(metrics).forEach(function(key) { | ||
| if (!(key.match(/^ibmmq_.*$/))) { | ||
| event.Delete("prometheus.metrics." + key); | ||
| } | ||
| }); | ||
| metrics = event.Get("prometheus.metrics"); | ||
| if (Object.keys(metrics).length == 0) { | ||
| event.Cancel(); | ||
| } | ||
| } | ||
| ---- | ||
|
|
||
| It also supports the options described in <<module-http-config-options>>. | ||
|
|
||
| [float] | ||
| === Metricsets | ||
|
|
||
| The following metricsets are available: | ||
|
|
||
| * <<metricbeat-metricset-ibmmq-qmgr,qmgr>> | ||
|
|
||
| include::ibmmq/qmgr.asciidoc[] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //// | ||
| This file is generated! See scripts/mage/docs_collector.go | ||
| //// | ||
|
|
||
| [[metricbeat-metricset-ibmmq-qmgr]] | ||
| === IBM MQ qmgr metricset | ||
|
|
||
| beta[] | ||
|
|
||
| include::../../../../x-pack/metricbeat/module/ibmmq/qmgr/_meta/docs.asciidoc[] | ||
|
|
||
| This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. | ||
|
|
||
| ==== Fields | ||
|
|
||
| For a description of each field in the metricset, see the | ||
| <<exported-fields-ibmmq,exported fields>> section. | ||
|
|
||
| Here is an example document generated by this metricset: | ||
|
|
||
| [source,json] | ||
| ---- | ||
| include::../../../../x-pack/metricbeat/module/ibmmq/qmgr/_meta/data.json[] | ||
| ---- |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -503,6 +503,36 @@ metricbeat.modules: | |
| # fields: # added to the the response in root. overwrites existing fields | ||
| # key: "value" | ||
|
|
||
| #-------------------------------- IBM MQ Module -------------------------------- | ||
| - module: ibmmq | ||
| metricsets: ['qmgr'] | ||
| period: 10s | ||
| hosts: ['localhost:9157'] | ||
|
|
||
| # This module uses the Prometheus collector metricset, all | ||
| # the options for this metricset are also available here. | ||
| metrics_path: /metrics | ||
|
|
||
| # The custom processor is responsible for filtering Prometheus metrics | ||
| # not stricly related to the IBM MQ domain, e.g. system load, process, | ||
| # metrics HTTP server. | ||
| processors: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a short comment/description here of why we decided to use js processor here could be of worth
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added! |
||
| - script: | ||
| lang: javascript | ||
| source: > | ||
| function process(event) { | ||
| var metrics = event.Get("prometheus.metrics"); | ||
| Object.keys(metrics).forEach(function(key) { | ||
| if (!(key.match(/^ibmmq_.*$/))) { | ||
| event.Delete("prometheus.metrics." + key); | ||
| } | ||
| }); | ||
| metrics = event.Get("prometheus.metrics"); | ||
| if (Object.keys(metrics).length == 0) { | ||
| event.Cancel(); | ||
| } | ||
| } | ||
|
|
||
| #------------------------------- Jolokia Module ------------------------------- | ||
| - module: jolokia | ||
| #metricsets: ["jmx"] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ARG IBMMQ_VERSION | ||
|
|
||
| FROM ibmcom/mq:${IBMMQ_VERSION} | ||
|
|
||
| ENV IBMMQ_METRICS_REST_PORT=9157 | ||
|
|
||
| ENV LICENSE=accept | ||
| ENV MQ_QMGR_NAME=QM1 | ||
| ENV MQ_ENABLE_METRICS=true | ||
|
|
||
| HEALTHCHECK --interval=1s --retries=90 CMD curl -s --fail http://127.0.0.1:${IBMMQ_METRICS_REST_PORT}/metrics | grep -q "ibmmq_qmgr_commit_total" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| - module: ibmmq | ||
| metricsets: ['qmgr'] | ||
| period: 10s | ||
| hosts: ['localhost:9157'] | ||
|
|
||
| # This module uses the Prometheus collector metricset, all | ||
| # the options for this metricset are also available here. | ||
| metrics_path: /metrics | ||
|
|
||
| # The custom processor is responsible for filtering Prometheus metrics | ||
| # not stricly related to the IBM MQ domain, e.g. system load, process, | ||
| # metrics HTTP server. | ||
| processors: | ||
| - script: | ||
| lang: javascript | ||
| source: > | ||
| function process(event) { | ||
| var metrics = event.Get("prometheus.metrics"); | ||
| Object.keys(metrics).forEach(function(key) { | ||
| if (!(key.match(/^ibmmq_.*$/))) { | ||
| event.Delete("prometheus.metrics." + key); | ||
| } | ||
| }); | ||
| metrics = event.Get("prometheus.metrics"); | ||
| if (Object.keys(metrics).length == 0) { | ||
| event.Cancel(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| This module periodically fetches metrics from a containerized distribution of IBM MQ. | ||
|
|
||
| [float] | ||
| === Compatibility | ||
|
|
||
| The ibmmq `qmgr` metricset is compatible with a containerized distribution of IBM MQ (since version 9.1.0). | ||
| The Docker image starts the `runmqserver` process, which spawns the HTTP server exposing metrics in Prometheus | ||
| format ([source code](https://github.com/ibm-messaging/mq-container/blob/9.1.0/internal/metrics/metrics.go)). | ||
|
|
||
| The Docker container lifecycle, including metrics collection, has been described in the [Internals](https://github.com/ibm-messaging/mq-container/blob/9.1.0/docs/internals.md) | ||
| document. | ||
|
|
||
| The image provides an option to easily enable metrics exporter using an environment | ||
| variable: | ||
|
|
||
| `MQ_ENABLE_METRICS` - Set this to `true` to generate Prometheus metrics for the Queue Manager. | ||
|
|
||
| [float] | ||
| === Dashboard | ||
|
|
||
| The ibmmq module includes predefined dashboards with overview information | ||
| of the monitored Queue Manager, including subscriptions, calls and messages. | ||
|
|
||
| image::./images/metricbeat-ibmmq-calls.png[] | ||
|
|
||
| image::./images/metricbeat-ibmmq-messages.png[] | ||
|
|
||
| image::./images/metricbeat-ibmmq-subscriptions.png[] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| - key: ibmmq | ||
| title: 'IBM MQ' | ||
| release: beta | ||
| description: > | ||
| IBM MQ module | ||
| settings: ["http"] | ||
| fields: | ||
| - name: ibmmq | ||
| type: group | ||
| fields: |
Uh oh!
There was an error while loading. Please reload this page.