diff --git a/packages/prometheus/changelog.yml b/packages/prometheus/changelog.yml index 15c9a5fc88d..d3c94b61319 100644 --- a/packages/prometheus/changelog.yml +++ b/packages/prometheus/changelog.yml @@ -1,4 +1,9 @@ # newer versions go on top +- version: "0.10.0" + changes: + - description: Hide some configuration for remote_write data_stream; Add leader election for collector and query data_streams + type: enhancement + link: https://github.com/elastic/integrations/pull/3662 - version: "0.9.2" changes: - description: reworded a link to related documentation in the Readme so it is clearer diff --git a/packages/prometheus/data_stream/collector/agent/stream/stream.yml.hbs b/packages/prometheus/data_stream/collector/agent/stream/stream.yml.hbs index 36a2ecc8546..2557d47e62d 100644 --- a/packages/prometheus/data_stream/collector/agent/stream/stream.yml.hbs +++ b/packages/prometheus/data_stream/collector/agent/stream/stream.yml.hbs @@ -15,13 +15,18 @@ metrics_filters.include: metrics_path: {{metrics_path}} period: {{period}} rate_counters: {{rate_counters}} +{{#if ssl.certificate_authorities}} ssl.certificate_authorities: {{#each ssl.certificate_authorities}} - {{this}} {{/each}} +{{/if}} use_types: {{use_types}} username: {{username}} password: {{password}} +{{#if leaderelection}} +condition: ${kubernetes_leaderelection.leader} == true +{{/if}} {{#if query}} {{query}} {{/if}} @@ -33,4 +38,4 @@ password: {{password}} {{/if}} {{#if timeout}} {{timeout}} -{{/if}} \ No newline at end of file +{{/if}} diff --git a/packages/prometheus/data_stream/collector/manifest.yml b/packages/prometheus/data_stream/collector/manifest.yml index b3a3f83ae3b..cb78350a685 100644 --- a/packages/prometheus/data_stream/collector/manifest.yml +++ b/packages/prometheus/data_stream/collector/manifest.yml @@ -40,6 +40,13 @@ streams: required: true show_user: true default: true + - name: leaderelection + type: bool + title: Leader Election + multi: false + required: true + show_user: false + default: true - name: bearer_token_file type: text title: Bearer Token File @@ -53,8 +60,6 @@ streams: multi: true required: false show_user: false - default: - - /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt - name: metrics_filters.exclude type: text title: Metrics Filters Exclude diff --git a/packages/prometheus/data_stream/query/agent/stream/stream.yml.hbs b/packages/prometheus/data_stream/query/agent/stream/stream.yml.hbs index 009c2396fc8..71c2155e71d 100644 --- a/packages/prometheus/data_stream/query/agent/stream/stream.yml.hbs +++ b/packages/prometheus/data_stream/query/agent/stream/stream.yml.hbs @@ -5,3 +5,6 @@ hosts: {{/each}} period: {{period}} queries: {{queries}} +{{#if leaderelection}} +condition: ${kubernetes_leaderelection.leader} == true +{{/if}} diff --git a/packages/prometheus/data_stream/query/manifest.yml b/packages/prometheus/data_stream/query/manifest.yml index 8c502ea5938..1e5bb32b06a 100644 --- a/packages/prometheus/data_stream/query/manifest.yml +++ b/packages/prometheus/data_stream/query/manifest.yml @@ -45,6 +45,13 @@ streams: params: query: some_value path: /api/v1/query + - name: leaderelection + type: bool + title: Leader Election + multi: false + required: true + show_user: false + default: true title: Prometheus query metrics enabled: false description: Collect Prometheus query metrics diff --git a/packages/prometheus/data_stream/remote_write/manifest.yml b/packages/prometheus/data_stream/remote_write/manifest.yml index 359d169b07d..92d6a79d00b 100644 --- a/packages/prometheus/data_stream/remote_write/manifest.yml +++ b/packages/prometheus/data_stream/remote_write/manifest.yml @@ -23,21 +23,21 @@ streams: title: Enabled SSL multi: false required: true - show_user: true + show_user: false default: false - name: ssl.certificate type: text title: SSL Certificate multi: false required: false - show_user: true + show_user: false default: /etc/pki/server/cert.pem - name: ssl.key type: text title: SSL Key multi: false required: false - show_user: true + show_user: false default: /etc/pki/server/cert.key - name: rate_counters type: bool @@ -58,14 +58,14 @@ streams: title: Counter Type Patterns multi: true required: false - show_user: true + show_user: false default: [] - name: types_patterns.histogram_patterns type: text title: Histogram Type Patterns multi: true required: false - show_user: true + show_user: false default: [] title: Prometheus remote write metrics enabled: false diff --git a/packages/prometheus/manifest.yml b/packages/prometheus/manifest.yml index 72900fa1043..4d5c738a6ce 100644 --- a/packages/prometheus/manifest.yml +++ b/packages/prometheus/manifest.yml @@ -1,7 +1,7 @@ format_version: 1.0.0 name: prometheus title: Prometheus Metrics -version: 0.9.2 +version: 0.10.0 license: basic description: Collect metrics from Prometheus servers with Elastic Agent. type: integration