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: pushgateway extra parameters #320

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

weakcamel
Copy link
Contributor

Allow passing in additional parameters for the pushgateway binary

  • pushgateway_web_external_url - useful when running behind a reverse proxy
  • pushgateway_cli_extra_flags - additional extra flags for flexibility

Resolves #288

@weakcamel weakcamel changed the title pushgateway extra parameters feat: pushgateway extra parameters Mar 22, 2024
@github-actions github-actions bot added enhancement New feature or request roles/pushgateway labels Mar 22, 2024
@weakcamel weakcamel force-pushed the weakcamel/pushgateway_extra_cli_params branch from a0b982e to 55d9898 Compare March 22, 2024 11:13
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 22, 2024
@weakcamel weakcamel force-pushed the weakcamel/pushgateway_extra_cli_params branch from 55d9898 to dceb0ca Compare March 22, 2024 11:22
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 22, 2024
@weakcamel weakcamel force-pushed the weakcamel/pushgateway_extra_cli_params branch from dceb0ca to 24b74c8 Compare March 22, 2024 11:23
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 22, 2024
Allow passing in additional parameters for the pushgateway binary
* pushgateway_web_external_url - useful when running behind a reverse
  proxy
* pushgateway_cli_extra_flags - additional extra flags for
  flexibility

Signed-off-by: Waldek Maleska <waldekm@speechmatics.com>
@weakcamel weakcamel force-pushed the weakcamel/pushgateway_extra_cli_params branch from 24b74c8 to b63a01a Compare March 22, 2024 11:24
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 22, 2024
Copy link
Member

@gardar gardar left a comment

Choose a reason for hiding this comment

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

Please add the new options to the argument specs as well, they are located under meta/argument_specs.yml

Copy link
Contributor

github-actions bot commented Apr 10, 2024

Docs Build 📝

Thank you for contribution!✨

The docs for this PR have been published here:
https://prometheus-community.github.io/ansible/pr/320

You can compare to the docs for the main branch here:
https://prometheus-community.github.io/ansible/branch/main

The docsite for this PR is also available for download as an artifact from this run:
https://github.com/prometheus-community/ansible/actions/runs/8630884204

File changes:

Click to see the diff comparison.

NOTE: only file modifications are shown here. New and deleted files are excluded.
See the file list and check the published docs to see those files.

diff --git a/home/runner/work/ansible/ansible/docsbuild/base/pushgateway_role.html b/home/runner/work/ansible/ansible/docsbuild/head/pushgateway_role.html
index 73eeb40..ffe88cf 100644
--- a/home/runner/work/ansible/ansible/docsbuild/base/pushgateway_role.html
+++ b/home/runner/work/ansible/ansible/docsbuild/head/pushgateway_role.html
@@ -224,6 +224,14 @@ To check whether it is installed, run <code class="code docutils literal notrans
 </div></td>
 </tr>
 <tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-main--pushgateway_cli_extra_flags"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-cli-extra-flags"><strong>pushgateway_cli_extra_flags</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--pushgateway_cli_extra_flags" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Optional extra flags to be passed to pushgateway binary, e.g. [’–log.level=debug’, ‘–log.format=json’, ‘–web.enable-admin-api’]</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">[]</span></code></p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--pushgateway_http_server_config"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-http-server-config"><strong>pushgateway_http_server_config</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--pushgateway_http_server_config" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
 </div></td>
@@ -231,7 +239,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p>Keys and values are the same as in <a class="reference external" href="https://github.com/prometheus/pushgateway/blob/master/https/README.md#sample-config">pushgateway docs</a>.</p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--pushgateway_skip_install"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-skip-install"><strong>pushgateway_skip_install</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--pushgateway_skip_install" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
 </div></td>
@@ -243,7 +251,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 </ul>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--pushgateway_system_group"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-system-group"><strong>pushgateway_system_group</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--pushgateway_system_group" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -252,7 +260,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">&quot;pushgateway&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--pushgateway_system_user"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-system-user"><strong>pushgateway_system_user</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--pushgateway_system_user" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -261,7 +269,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">&quot;pushgateway&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--pushgateway_tls_server_config"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-tls-server-config"><strong>pushgateway_tls_server_config</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--pushgateway_tls_server_config" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
 </div></td>
@@ -269,7 +277,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p>Keys and values are the same as in <a class="reference external" href="https://github.com/prometheus/pushgateway/blob/master/https/README.md#sample-config">pushgateway docs</a>.</p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--pushgateway_version"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-version"><strong>pushgateway_version</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--pushgateway_version" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -277,6 +285,14 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">&quot;1.8.0&quot;</span></code></p>
 </div></td>
 </tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-main--pushgateway_web_external_url"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-web-external-url"><strong>pushgateway_web_external_url</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--pushgateway_web_external_url" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>External address on which pushgateway is available. Useful when behind reverse proxy, e.g.: <a class="reference external" href="https://example.org/pushgateway">https://example.org/pushgateway</a></p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p>
+</div></td>
+</tr>
 <tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--pushgateway_web_listen_address"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-pushgateway-role-parameter-main-pushgateway-web-listen-address"><strong>pushgateway_web_listen_address</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--pushgateway_web_listen_address" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>

@weakcamel
Copy link
Contributor Author

Please add the new options to the argument specs as well, they are located under meta/argument_specs.yml

Sure thing, done. PTAL

Copy link
Member

@gardar gardar left a comment

Choose a reason for hiding this comment

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

LGTM, can you please fix the DCO so that this can be merged?

Signed-off-by: Waldek Maleska <waldekm@speechmatics.com>
@weakcamel weakcamel force-pushed the weakcamel/pushgateway_extra_cli_params branch from 3731594 to 57572f9 Compare April 10, 2024 12:04
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 10, 2024
@weakcamel
Copy link
Contributor Author

LGTM, can you please fix the DCO so that this can be merged?

Silly me! of course, done.

@weakcamel weakcamel requested a review from gardar April 10, 2024 12:05

# Optional extra flags to be passed to pushgateway binary, e.g.
# ['--log.level=debug', '--log.format=json', '--web.enable-admin-api']
pushgateway_cli_extra_flags: []
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's follow the naming convention used in other roles. <role>_config_flags_extra.

Suggested change
pushgateway_cli_extra_flags: []
pushgateway_config_flags_extra: []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can I configure the web.external-url
3 participants