-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [Metricbeat] Implement IBM MQ module (#15301) * Modify cockroachdb source * Define testdata * Do not publish ports * Update docs * mage fmt update * Describe containerized environment * Update CHANGELOG.next.asciidoc Co-Authored-By: Chris Mark <chrismarkou92@gmail.com> * Update data.json * Rename image * Update source after review * Filter ibmmq_ metrics * mage check * Fix: mage check * Don't expose port * Rename status to qmgr * Add subscriptions overview dashboard for IBM MQ module * Add calls, messages overview dashboard for IBM MQ module * Add screenshots * Fix: mage check * Fix: CHANGELOG * Add explanation * Fix: mage check Co-authored-by: Chris Mark <chrismarkou92@gmail.com> (cherry picked from commit 2ed633b) * Fix: link * Bug
- Loading branch information
Showing
31 changed files
with
4,033 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
[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[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
Oops, something went wrong.