Skip to content

Commit

Permalink
Merge pull request #320 from speechmatics/weakcamel/pushgateway_extra…
Browse files Browse the repository at this point in the history
…_cli_params

feat: pushgateway extra parameters
  • Loading branch information
gardar authored Jan 12, 2025
2 parents 07fa4b6 + 8c201a7 commit 00dbdcb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
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

0 comments on commit 00dbdcb

Please sign in to comment.