From b129cb6e7e9fc8b0dc1a18f0a9305eefbda4e3d5 Mon Sep 17 00:00:00 2001 From: Chris Mark Date: Tue, 31 Mar 2020 12:12:29 +0300 Subject: [PATCH] Add prometheus metricsets configs in x-pack version (#17324) (#17348) (cherry picked from commit ea8248e8047a5cbf9ccd1e8f4aee0fc4edc01a3f) --- x-pack/metricbeat/metricbeat.reference.yml | 37 ++++++++++++++++++ .../module/prometheus/_meta/config.yml | 38 ++++++++++++++++++- .../modules.d/prometheus.yml.disabled | 38 ++++++++++++++++++- 3 files changed, 111 insertions(+), 2 deletions(-) diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 649dc852b51..b1c523c9695 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -1027,6 +1027,43 @@ metricbeat.modules: # Store counter rates instead of original cumulative counters (experimental, default: false) #rate_counters: true + +# Metrics sent by a Prometheus server using remote_write option +#- module: prometheus +# metricsets: ["remote_write"] +# host: "localhost" +# port: "9201" + + # Secure settings for the server using TLS/SSL: + #ssl.certificate: "/etc/pki/server/cert.pem" + #ssl.key: "/etc/pki/server/cert.key" + +# Metrics that will be collected using a PromQL +#- module: prometheus +# metricsets: ["query"] +# hosts: ["localhost:9090"] +# period: 10s +# queries: +# - name: "instant_vector" +# path: "/api/v1/query" +# params: +# query: "sum(rate(prometheus_http_requests_total[1m]))" +# - name: "range_vector" +# path: "/api/v1/query_range" +# params: +# query: "up" +# start: "2019-12-20T00:00:00.000Z" +# end: "2019-12-21T00:00:00.000Z" +# step: 1h +# - name: "scalar" +# path: "/api/v1/query" +# params: +# query: "100" +# - name: "string" +# path: "/api/v1/query" +# params: +# query: "some_value" + #------------------------------ Prometheus Module ------------------------------ # Metrics collected from a Prometheus endpoint - module: prometheus diff --git a/x-pack/metricbeat/module/prometheus/_meta/config.yml b/x-pack/metricbeat/module/prometheus/_meta/config.yml index 89e819e0c21..6fd4e582c8e 100644 --- a/x-pack/metricbeat/module/prometheus/_meta/config.yml +++ b/x-pack/metricbeat/module/prometheus/_meta/config.yml @@ -18,4 +18,40 @@ #use_types: true # Store counter rates instead of original cumulative counters (experimental, default: false) - #rate_counters: true \ No newline at end of file + #rate_counters: true + +# Metrics sent by a Prometheus server using remote_write option +#- module: prometheus +# metricsets: ["remote_write"] +# host: "localhost" +# port: "9201" + + # Secure settings for the server using TLS/SSL: + #ssl.certificate: "/etc/pki/server/cert.pem" + #ssl.key: "/etc/pki/server/cert.key" + +# Metrics that will be collected using a PromQL +#- module: prometheus +# metricsets: ["query"] +# hosts: ["localhost:9090"] +# period: 10s +# queries: +# - name: "instant_vector" +# path: "/api/v1/query" +# params: +# query: "sum(rate(prometheus_http_requests_total[1m]))" +# - name: "range_vector" +# path: "/api/v1/query_range" +# params: +# query: "up" +# start: "2019-12-20T00:00:00.000Z" +# end: "2019-12-21T00:00:00.000Z" +# step: 1h +# - name: "scalar" +# path: "/api/v1/query" +# params: +# query: "100" +# - name: "string" +# path: "/api/v1/query" +# params: +# query: "some_value" diff --git a/x-pack/metricbeat/modules.d/prometheus.yml.disabled b/x-pack/metricbeat/modules.d/prometheus.yml.disabled index 1343d7b4ba5..a6382d37622 100644 --- a/x-pack/metricbeat/modules.d/prometheus.yml.disabled +++ b/x-pack/metricbeat/modules.d/prometheus.yml.disabled @@ -21,4 +21,40 @@ #use_types: true # Store counter rates instead of original cumulative counters (experimental, default: false) - #rate_counters: true \ No newline at end of file + #rate_counters: true + +# Metrics sent by a Prometheus server using remote_write option +#- module: prometheus +# metricsets: ["remote_write"] +# host: "localhost" +# port: "9201" + + # Secure settings for the server using TLS/SSL: + #ssl.certificate: "/etc/pki/server/cert.pem" + #ssl.key: "/etc/pki/server/cert.key" + +# Metrics that will be collected using a PromQL +#- module: prometheus +# metricsets: ["query"] +# hosts: ["localhost:9090"] +# period: 10s +# queries: +# - name: "instant_vector" +# path: "/api/v1/query" +# params: +# query: "sum(rate(prometheus_http_requests_total[1m]))" +# - name: "range_vector" +# path: "/api/v1/query_range" +# params: +# query: "up" +# start: "2019-12-20T00:00:00.000Z" +# end: "2019-12-21T00:00:00.000Z" +# step: 1h +# - name: "scalar" +# path: "/api/v1/query" +# params: +# query: "100" +# - name: "string" +# path: "/api/v1/query" +# params: +# query: "some_value"