forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenMetrics Metricbeat module (elastic#16596)
(cherry picked from commit 3b35d0b)
- Loading branch information
Showing
21 changed files
with
609 additions
and
27 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
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,67 @@ | ||
//// | ||
This file is generated! See scripts/mage/docs_collector.go | ||
//// | ||
|
||
[[metricbeat-module-openmetrics]] | ||
[role="xpack"] | ||
== Openmetrics module | ||
|
||
beta[] | ||
|
||
This module periodically fetches metrics from endpoints following https://openmetrics.io/[Openmetrics] format. | ||
|
||
[float] | ||
=== Filtering metrics | ||
|
||
In order to filter out/in metrics one can make use of `metrics_filters.include` `metrics_filters.exclude` settings: | ||
|
||
[source,yaml] | ||
------------------------------------------------------------------------------------- | ||
- module: openmetrics | ||
metricsets: ['collector'] | ||
period: 10s | ||
hosts: ["localhost:9090"] | ||
metrics_path: /metrics | ||
metrics_filters: | ||
include: ["node_filesystem_*"] | ||
exclude: ["node_filesystem_device_*", "^node_filesystem_readonly$"] | ||
------------------------------------------------------------------------------------- | ||
|
||
The configuration above will include only metrics that match `node_filesystem_*` pattern and do not match `node_filesystem_device_*` | ||
and are not `node_filesystem_readonly` metric. | ||
|
||
|
||
[float] | ||
=== Example configuration | ||
|
||
The Openmetrics module supports the standard configuration options that are described | ||
in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
||
[source,yaml] | ||
---- | ||
metricbeat.modules: | ||
- module: openmetrics | ||
metricsets: ['collector'] | ||
period: 10s | ||
hosts: ['localhost:9090'] | ||
# This module uses the Prometheus collector metricset, all | ||
# the options for this metricset are also available here. | ||
metrics_path: /metrics | ||
metrics_filters: | ||
include: [] | ||
exclude: [] | ||
---- | ||
|
||
This module supports TLS connections when using `ssl` config field, as described in <<configuration-ssl>>. | ||
It also supports the options described in <<module-http-config-options>>. | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-openmetrics-collector,collector>> | ||
|
||
include::openmetrics/collector.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,23 @@ | ||
//// | ||
This file is generated! See scripts/mage/docs_collector.go | ||
//// | ||
|
||
[[metricbeat-metricset-openmetrics-collector]] | ||
=== Openmetrics collector metricset | ||
|
||
beta[] | ||
|
||
include::../../../../x-pack/metricbeat/module/openmetrics/collector/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-openmetrics,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../../x-pack/metricbeat/module/openmetrics/collector/_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
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 @@ | ||
- module: openmetrics | ||
metricsets: ['collector'] | ||
period: 10s | ||
hosts: ['localhost:9090'] | ||
|
||
# This module uses the Prometheus collector metricset, all | ||
# the options for this metricset are also available here. | ||
metrics_path: /metrics | ||
metrics_filters: | ||
include: [] | ||
exclude: [] |
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,21 @@ | ||
This module periodically fetches metrics from endpoints following https://openmetrics.io/[Openmetrics] format. | ||
|
||
[float] | ||
=== Filtering metrics | ||
|
||
In order to filter out/in metrics one can make use of `metrics_filters.include` `metrics_filters.exclude` settings: | ||
|
||
[source,yaml] | ||
------------------------------------------------------------------------------------- | ||
- module: openmetrics | ||
metricsets: ['collector'] | ||
period: 10s | ||
hosts: ["localhost:9090"] | ||
metrics_path: /metrics | ||
metrics_filters: | ||
include: ["node_filesystem_*"] | ||
exclude: ["node_filesystem_device_*", "^node_filesystem_readonly$"] | ||
------------------------------------------------------------------------------------- | ||
|
||
The configuration above will include only metrics that match `node_filesystem_*` pattern and do not match `node_filesystem_device_*` | ||
and are not `node_filesystem_readonly` metric. |
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 @@ | ||
- key: openmetrics | ||
title: 'Openmetrics' | ||
release: beta | ||
description: > | ||
Openmetrics module | ||
settings: ["http", "ssl"] | ||
fields: | ||
- name: openmetrics | ||
type: group | ||
description: > | ||
`openmetrics` contains metrics from endpoints that are following Openmetrics format. | ||
fields: | ||
# Order is important here, labels will match first, the rest are double | ||
- name: labels.* | ||
type: object | ||
object_type: keyword | ||
description: > | ||
Prometheus metric labels | ||
- name: metrics.* | ||
type: object | ||
object_type: double | ||
object_type_mapping_type: "*" | ||
description: > | ||
Prometheus metric |
25 changes: 25 additions & 0 deletions
25
x-pack/metricbeat/module/openmetrics/collector/_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"@timestamp": "2019-03-01T08:05:34.853Z", | ||
"event": { | ||
"dataset": "openmetrics.collector", | ||
"duration": 115000, | ||
"module": "openmetrics" | ||
}, | ||
"metricset": { | ||
"name": "collector", | ||
"period": 10000 | ||
}, | ||
"openmetrics": { | ||
"labels": { | ||
"device": "br-10229e3512d9", | ||
"job": "openmetrics" | ||
}, | ||
"metrics": { | ||
"node_network_carrier": 0 | ||
} | ||
}, | ||
"service": { | ||
"address": "127.0.0.1:55555", | ||
"type": "openmetrics" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
x-pack/metricbeat/module/openmetrics/collector/_meta/docs.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 @@ | ||
This is the `collector` metricset of the Openmetrics module. It collects metrics from endpoints that follow Openmetrics format. |
1 change: 1 addition & 0 deletions
1
x-pack/metricbeat/module/openmetrics/collector/_meta/fields.yml
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 @@ | ||
- release: beta |
4 changes: 4 additions & 0 deletions
4
x-pack/metricbeat/module/openmetrics/collector/_meta/testdata/config.yml
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,4 @@ | ||
type: http | ||
url: "/metrics" | ||
suffix: plain | ||
remove_fields_from_comparison: ["openmetrics.labels.instance"] |
11 changes: 11 additions & 0 deletions
11
x-pack/metricbeat/module/openmetrics/collector/_meta/testdata/docs.plain
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 @@ | ||
# HELP node_network_carrier carrier value of /sys/class/net/<iface>. | ||
# TYPE node_network_carrier gauge | ||
node_network_carrier{device="br-0cb306323b90"} 0 | ||
node_network_carrier{device="br-10229e3512d9"} 0 | ||
node_network_carrier{device="br-210476dc4ef8"} 0 | ||
node_network_carrier{device="br-33d819d5f834"} 0 | ||
node_network_carrier{device="br-38425a39f36b"} 0 | ||
node_network_carrier{device="br-38feb0aad6ab"} 0 | ||
node_network_carrier{device="br-3a285aa5e58c"} 0 | ||
node_network_carrier{device="br-425cb4c454a6"} 0 | ||
node_network_carrier{device="br-4e623477470e"} 0 |
Oops, something went wrong.