Sfoglia il codice sorgente

Remove dead metrics support from the Steam bridge

The bridge does not expose a metrics endpoint, so the playbook was
publishing a Traefik route which could only ever yield an HTTP 502.

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5487
pull/5494/head
Slavi Pantaleev 2 giorni fa
parent
commit
034ccf15de
4 ha cambiato i file con 12 aggiunte e 67 eliminazioni
  1. +0
    -9
      group_vars/matrix_servers
  2. +0
    -21
      roles/custom/matrix-bridge-steam/defaults/main.yml
  3. +12
    -2
      roles/custom/matrix-bridge-steam/tasks/validate_config.yml
  4. +0
    -35
      roles/custom/matrix-bridge-steam/templates/labels.j2

+ 0
- 9
group_vars/matrix_servers Vedi File

@@ -3060,9 +3060,6 @@ matrix_bridge_steam_container_labels_traefik_docker_network: "{{ matrix_playbook
matrix_bridge_steam_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
matrix_bridge_steam_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"

matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_enabled: "{{ matrix_metrics_exposure_http_basic_auth_enabled }}"
matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_users: "{{ matrix_metrics_exposure_http_basic_auth_users }}"

matrix_bridge_steam_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':steam.as.token') | hash('sha512') | to_uuid }}"

matrix_bridge_steam_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
@@ -3083,12 +3080,6 @@ matrix_bridge_steam_double_puppet_secrets_auto: |-
else {}
}}

matrix_bridge_steam_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}"

matrix_bridge_steam_metrics_proxying_enabled: "{{ matrix_bridge_steam_metrics_enabled and matrix_metrics_exposure_enabled }}"
matrix_bridge_steam_metrics_proxying_hostname: "{{ matrix_metrics_exposure_hostname }}"
matrix_bridge_steam_metrics_proxying_path_prefix: "{{ matrix_metrics_exposure_path_prefix }}/matrix-steam-bridge"

matrix_bridge_steam_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
matrix_bridge_steam_database_password: "{{ (matrix_homeserver_generic_secret_key + ':mau.twt.db') | hash('sha512') | to_uuid if postgres_enabled else '' }}"



+ 0
- 21
roles/custom/matrix-bridge-steam/defaults/main.yml Vedi File

@@ -94,17 +94,6 @@ matrix_bridge_steam_container_labels_traefik_entrypoints: web-secure
matrix_bridge_steam_container_labels_traefik_tls: "{{ matrix_bridge_steam_container_labels_traefik_entrypoints != 'web' }}"
matrix_bridge_steam_container_labels_traefik_tls_certResolver: default # noqa var-naming

# Controls whether labels will be added that expose mautrix-instagram's metrics
matrix_bridge_steam_container_labels_metrics_enabled: "{{ matrix_bridge_steam_metrics_enabled and matrix_bridge_steam_metrics_proxying_enabled }}"
matrix_bridge_steam_container_labels_metrics_traefik_rule: "Host(`{{ matrix_bridge_steam_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_bridge_steam_metrics_proxying_path_prefix }}`)"
matrix_bridge_steam_container_labels_metrics_traefik_priority: 0
matrix_bridge_steam_container_labels_metrics_traefik_entrypoints: "{{ matrix_bridge_steam_container_labels_traefik_entrypoints }}"
matrix_bridge_steam_container_labels_metrics_traefik_tls: "{{ matrix_bridge_steam_container_labels_metrics_traefik_entrypoints != 'web' }}"
matrix_bridge_steam_container_labels_metrics_traefik_tls_certResolver: "{{ matrix_bridge_steam_container_labels_traefik_tls_certResolver }}" # noqa var-naming
matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_enabled: false
# See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_users: ''

# matrix_bridge_steam_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
# See `../templates/labels.j2` for details.
#
@@ -199,16 +188,6 @@ matrix_bridge_steam_provisioning_shared_secret: disable
# Valid values: fatal, error, warn, info, debug, trace
matrix_bridge_steam_logging_level: 'warn'

# Whether or not metrics endpoint should be enabled.
# Enabling them is usually enough for a local (in-container) Prometheus to consume them.
# If metrics need to be consumed by another (external) Prometheus server, consider exposing them via `matrix_bridge_steam_metrics_proxying_enabled`.
matrix_bridge_steam_metrics_enabled: false

# Controls whether metrics should be exposed on a public URL.
matrix_bridge_steam_metrics_proxying_enabled: false
matrix_bridge_steam_metrics_proxying_hostname: ''
matrix_bridge_steam_metrics_proxying_path_prefix: ''

# Default configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it.
#


+ 12
- 2
roles/custom/matrix-bridge-steam/tasks/validate_config.yml Vedi File

@@ -20,6 +20,18 @@
- {'old': 'matrix_bridge_steam_docker_image_tag', 'new': 'matrix_bridge_steam_container_image_tag'}
- {'old': 'matrix_bridge_steam_docker_src_files_path', 'new': 'matrix_bridge_steam_container_src_files_path'}
- {'old': 'matrix_bridge_steam_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- {'old': 'matrix_bridge_steam_metrics_enabled', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_metrics_proxying_enabled', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_metrics_proxying_hostname', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_metrics_proxying_path_prefix', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_enabled', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_traefik_rule', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_traefik_priority', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_traefik_entrypoints', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_traefik_tls', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_traefik_tls_certResolver', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_enabled', 'new': '<removed> (the Steam bridge does not support metrics)'}
- {'old': 'matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_users', 'new': '<removed> (the Steam bridge does not support metrics)'}

- name: Fail if required matrix_bridge_steam settings not defined
ansible.builtin.fail:
@@ -32,6 +44,4 @@
- {'name': 'matrix_bridge_steam_homeserver_token', when: true}
- {'name': 'matrix_bridge_steam_database_hostname', when: "{{ matrix_bridge_steam_database_engine == 'postgres' }}"}
- {'name': 'matrix_bridge_steam_container_network', when: true}
- {'name': 'matrix_bridge_steam_metrics_proxying_hostname', when: "{{ matrix_bridge_steam_metrics_proxying_enabled }}"}
- {'name': 'matrix_bridge_steam_metrics_proxying_path_prefix', when: "{{ matrix_bridge_steam_metrics_proxying_enabled }}"}
# TODO: Confirm additional config isn't mandatory for public_media

+ 0
- 35
roles/custom/matrix-bridge-steam/templates/labels.j2 Vedi File

@@ -12,41 +12,6 @@ traefik.docker.network={{ matrix_bridge_steam_container_labels_traefik_docker_ne
{% endif %}

traefik.http.services.matrix-steam-bridge.loadbalancer.server.port={{ matrix_bridge_steam_appservice_port }}
traefik.http.services.matrix-steam-bridge-metrics.loadbalancer.server.port=8000

{% if matrix_bridge_steam_container_labels_metrics_enabled %}
############################################################
# #
# Metrics #
# #
############################################################

{% if matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_enabled %}
traefik.http.middlewares.matrix-steam-bridge-metrics-basic-auth.basicauth.users={{ matrix_bridge_steam_container_labels_metrics_middleware_basic_auth_users }}
traefik.http.routers.matrix-steam-bridge-metrics.middlewares=matrix-steam-bridge-metrics-basic-auth
{% endif %}

traefik.http.routers.matrix-steam-bridge-metrics.rule={{ matrix_bridge_steam_container_labels_metrics_traefik_rule }}

{% if matrix_bridge_steam_container_labels_metrics_traefik_priority | int > 0 %}
traefik.http.routers.matrix-steam-bridge-metrics.priority={{ matrix_bridge_steam_container_labels_metrics_traefik_priority }}
{% endif %}

traefik.http.routers.matrix-steam-bridge-metrics.service=matrix-steam-bridge-metrics
traefik.http.routers.matrix-steam-bridge-metrics.entrypoints={{ matrix_bridge_steam_container_labels_metrics_traefik_entrypoints }}

traefik.http.routers.matrix-steam-bridge-metrics.tls={{ matrix_bridge_steam_container_labels_metrics_traefik_tls | to_json }}
{% if matrix_bridge_steam_container_labels_metrics_traefik_tls %}
traefik.http.routers.matrix-steam-bridge-metrics.tls.certResolver={{ matrix_bridge_steam_container_labels_metrics_traefik_tls_certResolver }}
{% endif %}

############################################################
# #
# /Metrics #
# #
############################################################
{% endif %}


{% if matrix_bridge_steam_public_media_enabled %}
############################################################


Caricamento…
Annulla
Salva