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

feat: [prometheus_input] add support for leader election and condition #12876

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions packages/prometheus_input/agent/input/input.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ ssl.certificate_authorities:
{{/if}}
data_stream:
dataset: {{data_stream.dataset}}
{{#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 processors}}
processors:
{{processors}}
Expand Down
5 changes: 5 additions & 0 deletions packages/prometheus_input/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "0.8.0"
changes:
- description: Add support for defining Leader Election and Conditions
type: enhancement
link: https://github.com/elastic/integrations/pull/12876
- version: "0.7.1"
changes:
- description: Added description to ssl nodes in package level manifest.yml file to including links to documentation.
Expand Down
17 changes: 16 additions & 1 deletion packages/prometheus_input/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: "3.0.2"
name: prometheus_input
title: "Prometheus Input"
version: "0.7.1"
version: "0.8.0"
description: "Collects metrics from Prometheus exporter."
type: input
categories:
Expand Down Expand Up @@ -98,6 +98,21 @@ policy_templates:
default: prometheus
required: true
show_user: true
- name: leaderelection
type: bool
title: Leader Election
description: Enable leaderelection between a set of Elastic Agents running on Kubernetes. See [Kubernetes LeaderElection Provider](https://www.elastic.co/guide/en/fleet/current/kubernetes_leaderelection-provider.html) for details.
multi: false
required: true
show_user: true
default: false
- name: condition
title: Condition
description: Condition to filter when to collect this input. See [Dynamic Input Configuration](https://www.elastic.co/guide/en/fleet/current/dynamic-input-configuration.html) for details.
type: text
multi: false
required: false
show_user: true
- name: processors
type: yaml
title: Processors
Expand Down