Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable setting condition on Prometheus Collector #5317

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 8 additions & 1 deletion packages/prometheus/data_stream/collector/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ streams:
title: Leader Election
description: Enable leaderelection between a set of Elastic Agents running on Kubernetes
multi: false
required: true
required: false
BenB196 marked this conversation as resolved.
Show resolved Hide resolved
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