Skip to content

[prometheus_input] Add missing SSL fields to sync it with the Prometheus package #14503

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

Open
wants to merge 2 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
16 changes: 16 additions & 0 deletions packages/prometheus_input/agent/input/input.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,28 @@ metrics_filters.include:
{{#each metrics_filters.include}}
- {{this}}
{{/each}}
{{#if bearer_token_file}}
bearer_token_file: {{bearer_token_file}}
{{/if}}
ssl.verification_mode: {{ssl.verification_mode}}
{{#if ssl.certificate_authorities}}
ssl.certificate_authorities:
{{#each ssl.certificate_authorities}}
- {{this}}
{{/each}}
{{/if}}
{{#if ssl.certificate}}
ssl.certificate: {{ssl.certificate}}
{{/if}}
{{#if ssl.key}}
ssl.key: {{ssl.key}}
{{/if}}
{{#if ssl.key_passphrase}}
ssl.key_passphrase: {{ssl.key_passphrase}}
{{/if}}
{{#if ssl.ca_trusted_fingerprint}}
ssl.ca_trusted_fingerprint: {{ssl.ca_trusted_fingerprint}}
{{/if}}
Comment on lines +29 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this instead of having all these separate options for the same thing ssl option in UI?

{{#if ssl}}
ssl: {{ssl}}
{{/if}}

data_stream:
dataset: {{data_stream.dataset}}
{{#if leaderelection }}
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.9.0"
changes:
- description: Add SSL configuration options.
type: enhancement
link: https://github.com/elastic/integrations/pull/14503
- version: "0.8.0"
changes:
- description: Add support for defining Leader Election and Conditions
Expand Down
39 changes: 38 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.8.0"
version: "0.9.0"
description: "Collects metrics from Prometheus exporter."
type: input
categories:
Expand Down Expand Up @@ -70,13 +70,42 @@ policy_templates:
required: false
show_user: false
default: []
- name: ssl.verification_mode
type: text
title: SSL Verification Mode
description: SSL verification mode. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-verification-mode) for details.
multi: false
required: false
show_user: false
default: none
- name: ssl.certificate_authorities
type: text
title: SSL Certificate Authorities
description: SSL Certificate Authorities. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-certificate-authorities) for details.
multi: true
required: false
show_user: false
- name: ssl.certificate
type: text
title: SSL Certificate
description: SSL certificate. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-certificate) for details.
show_user: true
- name: ssl.key
type: text
title: SSL Private Key
description: SSL private key. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-key) for details.
show_user: true
- name: ssl.key_passphrase
type: password
title: SSL Key Passphrase
description: SSL key passphrase. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-key-passphrase) for details.
secret: true
show_user: true
- name: ssl.ca_trusted_fingerprint
type: text
title: SSL CA Trusted Fingerprint
description: SSL CA trusted fingerprint. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#ca_trusted_fingerprint) for details.
show_user: true
- name: username
type: text
title: Username
Expand Down Expand Up @@ -113,6 +142,14 @@ policy_templates:
multi: false
required: false
show_user: true
- name: bearer_token_file
type: text
title: 'HTTP config options: bearer_token_file'
description: If defined, the contents of the file will be read once at initialization and then the value will be used in an HTTP Authorization header.
multi: false
secret: false
required: false
show_user: false
- name: processors
type: yaml
title: Processors
Expand Down