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

Merged
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
8 changes: 8 additions & 0 deletions roles/pushgateway/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ pushgateway_checksums_url: "https://github.com/{{ _pushgateway_repo }}/releases/
pushgateway_web_listen_address: "0.0.0.0:9091"
pushgateway_web_telemetry_path: "/metrics"

# External address on which pushgateway is available.
# Useful when behind reverse proxy, e.g.: https://example.org/pushgateway
pushgateway_web_external_url: ""

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

pushgateway_tls_server_config: {}

pushgateway_http_server_config: {}
Expand Down
10 changes: 10 additions & 0 deletions roles/pushgateway/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ argument_specs:
pushgateway_web_telemetry_path:
description: "Path under which to expose metrics"
default: "/metrics"
pushgateway_web_external_url:
description: >
External address on which pushgateway is available.
Useful when behind reverse proxy, e.g.: https://example.org/pushgateway
default: ""
pushgateway_config_flags_extra:
description: >
Optional extra flags to be passed to pushgateway binary, e.g.
['--log.level=debug', '--log.format=json', '--web.enable-admin-api']
default: []
pushgateway_tls_server_config:
description:
- "Configuration for TLS authentication."
Expand Down
11 changes: 11 additions & 0 deletions roles/pushgateway/templates/pushgateway.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ ExecStart={{ pushgateway_binary_install_dir }}/pushgateway \
{% endfor %}
{% else %}
'--web.listen-address={{ pushgateway_web_listen_address }}' \
{% endif %}
{% if pushgateway_web_external_url %}
'--web.external-url={{ pushgateway_web_external_url }}' \
{% endif %}
{% if pushgateway_config_flags_extra and
pushgateway_config_flags_extra is iterable and
pushgateway_config_flags_extra is not mapping and
pushgateway_config_flags_extra is not string %}
{% for extra_flag in pushgateway_config_flags_extra %}
'{{ extra_flag }}' \
{% endfor %}
{% endif %}
'--web.telemetry-path={{ pushgateway_web_telemetry_path }}'

Expand Down
Loading