Skip to content

Commit

Permalink
Enable setting condition on Prometheus Collector (elastic#5317)
Browse files Browse the repository at this point in the history
* Enable setting condition on Prometheus Collector

* Fixed missed update of manifest

* exclude condition if null

* Re-add lost change to condition required

* Re-add leaderelection with condition

* Fix leaderelection required
  • Loading branch information
BenB196 authored and agithomas committed Mar 21, 2023
1 parent 1bd2bed commit 1e9b197
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/prometheus/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# newer versions go on top
- version: "1.2.0"
changes:
- description: Enable setting condition on Prometheus Collector
type: enhancement
link: https://github.com/elastic/integrations/pull/5317
- version: "1.1.0"
changes:
- description: Remove "integration" from the package name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ ssl.certificate_authorities:
use_types: {{use_types}}
username: {{username}}
password: {{password}}
{{#if leaderelection}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
{{#if query}}
{{query}}
{{/if}}
Expand Down
7 changes: 7 additions & 0 deletions packages/prometheus/data_stream/collector/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ streams:
required: true
show_user: true
default: false
- name: condition
title: Condition
description: Condition to filter when to apply this datastream
type: text
multi: false
required: false
show_user: true
- name: bearer_token_file
type: text
title: 'HTTP config options: bearer_token_file'
Expand Down
2 changes: 1 addition & 1 deletion packages/prometheus/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 1.0.0
name: prometheus
title: Prometheus
version: 1.1.0
version: 1.2.0
license: basic
description: Collect metrics from Prometheus servers with Elastic Agent.
type: integration
Expand Down

0 comments on commit 1e9b197

Please sign in to comment.