mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-02-28 18:03:10 +00:00
Relocate prometheus-nginxlog-exporter (#4938)
* Use `ansible-role-prometheus-nginxlog-exporter` Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Replace `matrix-prometheus-nginxlog-exporter` and `matrix_prometheus_nginxlog_exporter` Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Set `matrix-prometheus-nginxlog-exporter` to `prometheus_nginxlog_exporter_identifier` Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Set `prometheus_nginxlog_exporter_container_image_*` Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Remove `prometheus_nginxlog_exporter_container_image_registry_prefix_upstream` Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Move `prometheus_nginxlog_exporter_base_path` to matrix_servers Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Remove unused variables for exposing the service Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Update configuring-playbook-prometheus-grafana.md About prometheus-nginxlog-exporter Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Rename `prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto` Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Set variables Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Remove matrix-prometheus-nginxlog-exporter in favor of ansible-role-prometheus-nginxlog-exporter Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Update CHANGELOG.md Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> * Update setup.yml: sort entry Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> --------- Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5> Co-authored-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,3 +1,13 @@
|
||||
# 2026-02-17
|
||||
|
||||
## (BC Break) prometheus-nginxlog-exporter role has been relocated and variable names need adjustments
|
||||
|
||||
The role for prometheus-nginxlog-exporter has been relocated to the [mother-of-all-self-hosting](https://github.com/mother-of-all-self-hosting) organization.
|
||||
|
||||
Along with the relocation, the `matrix_prometheus_nginxlog_exporter_` prefix on its variable names has been renamed to `prometheus_nginxlog_exporter_`, so you need to adjust your `vars.yml` configuration.
|
||||
|
||||
As always, the playbook would let you know about this and point out any variables you may have missed.
|
||||
|
||||
# 2026-02-16
|
||||
|
||||
## matrix-appservice-slack has been removed from the playbook
|
||||
|
||||
@@ -83,7 +83,7 @@ See the project's [documentation](https://github.com/martin-helmich/prometheus-n
|
||||
To enable it, add the following configuration to your `vars.yml` file:
|
||||
|
||||
```yaml
|
||||
matrix_prometheus_nginxlog_exporter_enabled: true
|
||||
prometheus_nginxlog_exporter_enabled: true
|
||||
```
|
||||
|
||||
If you enable Grafana, a dedicated `NGINX PROXY` Grafana dashboard will be created.
|
||||
@@ -95,8 +95,8 @@ If you enable Grafana, a dedicated `NGINX PROXY` Grafana dashboard will be creat
|
||||
At the moment of writing only images for `amd64` and `arm64` architectures are available. The playbook currently does not support [self-building](./self-building.md) a container image on other architectures. You can however use a custom-build image by setting:
|
||||
|
||||
```yaml
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_arch_check_enabled: false
|
||||
matrix_prometheus_nginxlog_exporter_docker_image: path/to/docker/image:tag
|
||||
prometheus_nginxlog_exporter_container_image_arch_check_enabled: false
|
||||
prometheus_nginxlog_exporter_container_image: path/to/docker/image:tag
|
||||
```
|
||||
|
||||
### Extending the configuration
|
||||
@@ -106,7 +106,7 @@ There are some additional things you may wish to configure about Prometheus and
|
||||
Take a look at:
|
||||
|
||||
- [Prometheus role](https://github.com/mother-of-all-self-hosting/ansible-role-prometheus)'s [`defaults/main.yml`](https://github.com/mother-of-all-self-hosting/ansible-role-prometheus/blob/main/defaults/main.yml) for some variables that you can customize via your `vars.yml` file. You can override settings (even those that don't have dedicated playbook variables) using the `prometheus_configuration_extension_yaml` variable
|
||||
- `roles/custom/matrix-prometheus-nginxlog-exporter/defaults/main.yml` for some variables that you can customize via your `vars.yml` file
|
||||
- `roles/galaxy/prometheus_nginxlog_exporter/defaults/main.yml` for some variables that you can customize via your `vars.yml` file
|
||||
|
||||
## Adjusting the playbook configuration — Grafana
|
||||
|
||||
@@ -181,8 +181,8 @@ Name | Description
|
||||
`prometheus_node_exporter_container_labels_traefik_enabled`|Set this to `true` to expose the node (general system stats) metrics on `https://matrix.example.com/metrics/node-exporter`.
|
||||
`prometheus_postgres_exporter_enabled`|Set this to `true` to enable the [Postgres exporter](#enable-metrics-and-graphs-for-postgres-optional) (locally, on the container network).
|
||||
`prometheus_postgres_exporter_container_labels_traefik_enabled`|Set this to `true` to expose the [Postgres exporter](#enable-metrics-and-graphs-for-postgres-optional) metrics on `https://matrix.example.com/metrics/postgres-exporter`.
|
||||
`matrix_prometheus_nginxlog_exporter_enabled`|Set this to `true` to enable the [nginx Log exporter](#enable-metrics-and-graphs-for-nginx-logs-optional) (locally, on the container network).
|
||||
`matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled`|Set this to `true` to expose the [nginx Log exporter](#enable-metrics-and-graphs-for-nginx-logs-optional) metrics on `https://matrix.example.com/metrics/nginxlog`.
|
||||
`prometheus_nginxlog_exporter_enabled`|Set this to `true` to enable the [prometheus-nginxlog-exporter](#enable-metrics-and-graphs-for-nginx-logs-optional) (locally, on the container network).
|
||||
`prometheus_nginxlog_exporter_container_labels_traefik_enabled`|Set this to `true` to expose the [prometheus-nginxlog-exporter](#enable-metrics-and-graphs-for-nginx-logs-optional) metrics on `https://matrix.example.com/metrics/nginxlog`.
|
||||
|
||||
### Expose metrics of other services/roles
|
||||
|
||||
|
||||
@@ -760,11 +760,11 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
}] if prometheus_postgres_exporter_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-prometheus-nginxlog-exporter.service',
|
||||
'name': (prometheus_nginxlog_exporter_identifier + '.service'),
|
||||
'priority': 3900,
|
||||
'restart_necessary': (matrix_prometheus_nginxlog_exporter_restart_necessary | bool),
|
||||
'restart_necessary': (prometheus_nginxlog_exporter_restart_necessary | bool),
|
||||
'groups': ['matrix', 'monitoring', 'prometheus-exporters', 'prometheus-nginxlog-exporter'],
|
||||
}] if matrix_prometheus_nginxlog_exporter_enabled else [])
|
||||
}] if prometheus_nginxlog_exporter_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': (valkey_identifier + '.service'),
|
||||
@@ -4854,7 +4854,7 @@ matrix_synapse_reverse_proxy_companion_container_additional_networks_auto: |
|
||||
(
|
||||
([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network else [])
|
||||
+
|
||||
([matrix_prometheus_nginxlog_exporter_container_network] if (matrix_prometheus_nginxlog_exporter_enabled and matrix_prometheus_nginxlog_exporter_container_network != matrix_synapse_reverse_proxy_companion_container_network) else [])
|
||||
([prometheus_nginxlog_exporter_container_network] if (prometheus_nginxlog_exporter_enabled and prometheus_nginxlog_exporter_container_network != matrix_synapse_reverse_proxy_companion_container_network) else [])
|
||||
+
|
||||
([] if matrix_homeserver_container_network in ['', matrix_synapse_reverse_proxy_companion_container_network] else [matrix_homeserver_container_network])
|
||||
) | unique
|
||||
@@ -4903,8 +4903,8 @@ matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_wor
|
||||
matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations: "{{matrix_synapse_workers_media_repository_endpoints|default([]) }}"
|
||||
matrix_synapse_reverse_proxy_companion_synapse_user_dir_locations: "{{ matrix_synapse_workers_user_dir_worker_client_server_endpoints|default([]) }}"
|
||||
|
||||
matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_enabled: "{{ matrix_prometheus_nginxlog_exporter_enabled }}"
|
||||
matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_server_port: "{{ (matrix_prometheus_nginxlog_exporter_identifier | string +':'+ matrix_prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}"
|
||||
matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_enabled: "{{ prometheus_nginxlog_exporter_enabled }}"
|
||||
matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_server_port: "{{ (prometheus_nginxlog_exporter_identifier | string +':'+ prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
@@ -5212,41 +5212,48 @@ prometheus_postgres_exporter_systemd_required_services_list_auto: |
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-prometheus-nginxlog-exporter
|
||||
# prometheus_nginxlog_exporter
|
||||
#
|
||||
######################################################################
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_enabled: false
|
||||
prometheus_nginxlog_exporter_enabled: false
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_identifier: matrix-prometheus-nginxlog-exporter
|
||||
prometheus_nginxlog_exporter_identifier: matrix-prometheus-nginxlog-exporter
|
||||
prometheus_nginxlog_exporter_base_path: "{{ matrix_base_data_path }}/prometheus-nginxlog-exporter"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_hostname: "{{ matrix_server_fqn_matrix }}"
|
||||
prometheus_nginxlog_exporter_uid: "{{ matrix_user_uid }}"
|
||||
prometheus_nginxlog_exporter_gid: "{{ matrix_user_gid }}"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream_default }}"
|
||||
prometheus_nginxlog_exporter_hostname: "{{ matrix_server_fqn_matrix }}"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_container_network: "{{ matrix_monitoring_container_network }}"
|
||||
prometheus_nginxlog_exporter_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else prometheus_nginxlog_exporter_container_image_registry_prefix_upstream_default }}"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_container_additional_networks_auto: |-
|
||||
prometheus_nginxlog_exporter_container_network: "{{ matrix_monitoring_container_network }}"
|
||||
prometheus_nginxlog_exporter_container_network_deletion_enabled: false
|
||||
|
||||
prometheus_nginxlog_exporter_container_additional_networks_auto: |-
|
||||
{{
|
||||
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_prometheus_nginxlog_exporter_container_labels_traefik_enabled) else [])
|
||||
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and prometheus_nginxlog_exporter_container_labels_traefik_enabled) else [])
|
||||
}}
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_enabled: "{{ matrix_metrics_exposure_enabled }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
|
||||
prometheus_nginxlog_exporter_container_labels_traefik_enabled: "{{ matrix_metrics_exposure_enabled }}"
|
||||
prometheus_nginxlog_exporter_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
|
||||
prometheus_nginxlog_exporter_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
|
||||
prometheus_nginxlog_exporter_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_enabled: "{{ matrix_metrics_exposure_http_basic_auth_enabled }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_users: "{{ matrix_metrics_exposure_http_basic_auth_users }}"
|
||||
prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_enabled: "{{ matrix_metrics_exposure_http_basic_auth_enabled }}"
|
||||
prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_users: "{{ matrix_metrics_exposure_http_basic_auth_users }}"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto: |
|
||||
prometheus_nginxlog_exporter_config_namespaces_source_tags_auto: |
|
||||
{{
|
||||
([matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_tag] if matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_enabled else [])
|
||||
}}
|
||||
|
||||
prometheus_nginxlog_exporter_architecture: "{{ matrix_architecture }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# /matrix-prometheus-nginxlog-exporter
|
||||
# /prometheus_nginxlog_exporter
|
||||
#
|
||||
######################################################################
|
||||
|
||||
@@ -5273,6 +5280,8 @@ prometheus_container_network: "{{ matrix_monitoring_container_network }}"
|
||||
prometheus_container_additional_networks_auto: |
|
||||
{{
|
||||
(
|
||||
([prometheus_nginxlog_exporter_container_network] if matrix_prometheus_services_connect_scraper_nginxlog_enabled and prometheus_nginxlog_exporter_container_network != prometheus_container_network else [])
|
||||
+
|
||||
([prometheus_node_exporter_container_network] if prometheus_self_node_scraper_enabled and prometheus_node_exporter_container_network != prometheus_container_network else [])
|
||||
+
|
||||
([matrix_synapse_container_network] if matrix_prometheus_services_connect_scraper_synapse_enabled and matrix_synapse_container_network != prometheus_container_network else [])
|
||||
@@ -5281,8 +5290,6 @@ prometheus_container_additional_networks_auto: |
|
||||
+
|
||||
([matrix_hookshot_container_network] if matrix_prometheus_services_connect_scraper_hookshot_enabled and matrix_hookshot_container_network != prometheus_container_network else [])
|
||||
+
|
||||
([matrix_prometheus_nginxlog_exporter_container_network] if matrix_prometheus_services_connect_scraper_nginxlog_enabled and matrix_prometheus_nginxlog_exporter_container_network != prometheus_container_network else [])
|
||||
+
|
||||
([matrix_media_repo_container_network] if matrix_prometheus_services_connect_scraper_media_repo_enabled and matrix_media_repo_container_network != prometheus_container_network else [])
|
||||
+
|
||||
([matrix_synapse_usage_exporter_container_network] if matrix_prometheus_services_connect_scraper_synapse_usage_exporter_enabled and matrix_synapse_usage_exporter_container_network != prometheus_container_network else [])
|
||||
@@ -5344,8 +5351,8 @@ matrix_prometheus_services_connect_scraper_postgres_static_configs_target: "{{ p
|
||||
matrix_prometheus_services_connect_scraper_hookshot_enabled: "{{ matrix_hookshot_enabled and matrix_hookshot_metrics_enabled }}"
|
||||
matrix_prometheus_services_connect_scraper_hookshot_static_configs_target: "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_metrics_port | string }}"
|
||||
|
||||
matrix_prometheus_services_connect_scraper_nginxlog_enabled: "{{ matrix_prometheus_nginxlog_exporter_enabled }}"
|
||||
matrix_prometheus_services_connect_scraper_nginxlog_static_configs_target: "{{ matrix_prometheus_nginxlog_exporter_identifier }}:{{ matrix_prometheus_nginxlog_exporter_container_metrics_port | string }}"
|
||||
matrix_prometheus_services_connect_scraper_nginxlog_enabled: "{{ prometheus_nginxlog_exporter_enabled }}"
|
||||
matrix_prometheus_services_connect_scraper_nginxlog_static_configs_target: "{{ prometheus_nginxlog_exporter_identifier }}:{{ prometheus_nginxlog_exporter_container_metrics_port | string }}"
|
||||
|
||||
matrix_prometheus_services_connect_scraper_media_repo_enabled: "{{ matrix_media_repo_enabled and matrix_media_repo_metrics_enabled }}"
|
||||
matrix_prometheus_services_connect_scraper_media_repo_static_configs_target: "{{ matrix_media_repo_identifier }}:{{ matrix_media_repo_metrics_port }}"
|
||||
@@ -5418,7 +5425,7 @@ grafana_dashboard_download_urls: |
|
||||
+
|
||||
(prometheus_postgres_exporter_dashboard_urls if prometheus_postgres_exporter_enabled else [])
|
||||
+
|
||||
(matrix_prometheus_nginxlog_exporter_dashboard_urls if matrix_prometheus_nginxlog_exporter_enabled else [])
|
||||
(prometheus_nginxlog_exporter_dashboard_urls if prometheus_nginxlog_exporter_enabled else [])
|
||||
+
|
||||
(matrix_media_repo_dashboard_urls if matrix_media_repo_metrics_enabled else [])
|
||||
+
|
||||
@@ -5428,9 +5435,9 @@ grafana_dashboard_download_urls: |
|
||||
grafana_provisioning_dashboard_template_files: |
|
||||
{{
|
||||
([{
|
||||
'path': 'roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json',
|
||||
'path': 'roles/galaxy/prometheus_nginxlog_exporter/templates/grafana/nginx-proxy.json',
|
||||
'name': 'nginx-proxy.json',
|
||||
}] if matrix_prometheus_nginxlog_exporter_enabled else [])
|
||||
}] if prometheus_nginxlog_exporter_enabled else [])
|
||||
}}
|
||||
|
||||
grafana_default_home_dashboard_path: |-
|
||||
|
||||
@@ -65,6 +65,9 @@
|
||||
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus.git
|
||||
version: v3.9.1-0
|
||||
name: prometheus
|
||||
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-nginxlog-exporter.git
|
||||
version: v1.10.0-0
|
||||
name: prometheus_nginxlog_exporter
|
||||
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-node-exporter.git
|
||||
version: v1.9.1-13
|
||||
name: prometheus_node_exporter
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2023 - 2025 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2023 Samuel Meenzen
|
||||
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
# prometheus-nginxlog-exporter exports nginx logs in a prometheus usable format on a `/metrics/ endpoint
|
||||
# See: https://github.com/martin-helmich/prometheus-nginxlog-exporter/
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_enabled: true
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_identifier: ''
|
||||
|
||||
# You don't need to configure a hostname and path prefix if you're not exposing this.
|
||||
matrix_prometheus_nginxlog_exporter_hostname: ''
|
||||
matrix_prometheus_nginxlog_exporter_path_prefix: "/metrics/nginxlog"
|
||||
|
||||
# renovate: datasource=docker depName=ghcr.io/martin-helmich/prometheus-nginxlog-exporter/exporter
|
||||
matrix_prometheus_nginxlog_exporter_version: v1.10.0
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_container_metrics_port: '4040'
|
||||
matrix_prometheus_nginxlog_exporter_container_syslog_port: '6514'
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_arch: ['amd64', 'arm64']
|
||||
matrix_prometheus_nginxlog_exporter_docker_image: "{{ matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix }}martin-helmich/prometheus-nginxlog-exporter/exporter:{{ matrix_prometheus_nginxlog_exporter_docker_image_tag }}"
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix: "{{ matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream }}"
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream: "{{ matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream_default }}"
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream_default: "ghcr.io/"
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_tag: "{{ 'latest' if matrix_prometheus_nginxlog_exporter_version == 'master' else matrix_prometheus_nginxlog_exporter_version }}-{{ matrix_architecture }}"
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_force_pull: "{{ matrix_prometheus_nginxlog_exporter_docker_image.endswith(':latest') }}"
|
||||
matrix_prometheus_nginxlog_exporter_docker_image_arch_check_enabled: true
|
||||
|
||||
# Controls whether prometheus-nginxlog-exporter metrics should be proxied (exposed) on a public URL
|
||||
matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled: false
|
||||
matrix_prometheus_nginxlog_exporter_metrics_proxying_hostname: ''
|
||||
matrix_prometheus_nginxlog_exporter_metrics_proxying_path_prefix: ''
|
||||
|
||||
# matrix_prometheus_nginxlog_exporter_dashboard_urls contains a list of URLs with Grafana dashboard definitions.
|
||||
# If the Grafana role is enabled, these dashboards will be downloaded.
|
||||
matrix_prometheus_nginxlog_exporter_dashboard_urls: []
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_base_path: "{{ matrix_base_data_path }}/prometheus-nginxlog-exporter"
|
||||
matrix_prometheus_nginxlog_exporter_config_path: "{{ matrix_prometheus_nginxlog_exporter_base_path }}/config"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_container_network: "{{ matrix_prometheus_nginxlog_exporter_identifier }}"
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_container_additional_networks: "{{ matrix_prometheus_nginxlog_exporter_container_additional_networks_auto + matrix_prometheus_nginxlog_exporter_container_additional_networks_custom }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_additional_networks_auto: []
|
||||
matrix_prometheus_nginxlog_exporter_container_additional_networks_custom: []
|
||||
|
||||
# matrix_prometheus_nginxlog_exporter_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# To inject your own other container labels, see `matrix_prometheus_nginxlog_exporter_container_labels_additional_labels`.
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_enabled: "{{ true if matrix_prometheus_nginxlog_exporter_hostname else false }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_docker_network: "{{ matrix_prometheus_nginxlog_exporter_container_network }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_hostname: "{{ matrix_prometheus_nginxlog_exporter_hostname }}"
|
||||
# The path prefix must either be `/` or not end with a slash (e.g. `/metrics`).
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_path_prefix: "{{ matrix_prometheus_nginxlog_exporter_path_prefix }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_rule: "Host(`{{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_hostname }}`) && PathPrefix(`{{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_path_prefix }}`)"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_entrypoints: web-secure
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_tls: "{{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_entrypoints != 'web' }}"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_traefik_tls_certResolver: default # noqa var-naming
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_enabled: false
|
||||
# See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_users: ''
|
||||
|
||||
# matrix_prometheus_nginxlog_exporter_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# Example:
|
||||
# matrix_prometheus_nginxlog_exporter_container_labels_additional_labels: |
|
||||
# my.label=1
|
||||
# another.label="here"
|
||||
matrix_prometheus_nginxlog_exporter_container_labels_additional_labels: ''
|
||||
|
||||
# A list of extra docker arguments to pass to the container
|
||||
matrix_prometheus_nginxlog_exporter_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-prometheus_nginxlog_exporter.service depends on
|
||||
matrix_prometheus_nginxlog_exporter_systemd_required_services_list: "{{ matrix_prometheus_nginxlog_exporter_systemd_required_services_list_default + matrix_prometheus_nginxlog_exporter_systemd_required_services_list_auto + matrix_prometheus_nginxlog_exporter_systemd_required_services_list_custom }}"
|
||||
matrix_prometheus_nginxlog_exporter_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_prometheus_nginxlog_exporter_systemd_required_services_list_auto: []
|
||||
matrix_prometheus_nginxlog_exporter_systemd_required_services_list_custom: []
|
||||
|
||||
# List of systemd services that matrix-prometheus_nginxlog_exporter.service wants
|
||||
matrix_prometheus_nginxlog_exporter_systemd_wanted_services_list: []
|
||||
|
||||
# Controls whether the matrix-prometheus_nginxlog_exporter container exposes its HTTP port (tcp/4040 in the container).
|
||||
#
|
||||
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:4040"), or empty string to not expose.
|
||||
matrix_prometheus_nginxlog_exporter_container_http_host_bind_port: ''
|
||||
|
||||
# Controls whether the matrix-prometheus_nginxlog_exporter container exposes its SYSLOG port (udp/6514 in the container).
|
||||
#
|
||||
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:6514"), or empty string to not expose.
|
||||
# Note: is an UDP connection!
|
||||
matrix_prometheus_nginxlog_exporter_container_syslog_host_bind_port: ''
|
||||
|
||||
matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags: "{{ matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto + matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_custom }}"
|
||||
matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto: []
|
||||
matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_custom: []
|
||||
|
||||
# matrix_prometheus_nginxlog_exporter_restart_necessary controls whether the service
|
||||
# will be restarted (when true) or merely started (when false) by the
|
||||
# systemd service manager role (when conditional restart is enabled).
|
||||
#
|
||||
# This value is automatically computed during installation based on whether
|
||||
# any configuration files, the systemd service file, or the container image changed.
|
||||
# The default of `false` means "no restart needed" — appropriate when the role's
|
||||
# installation tasks haven't run (e.g., due to --tags skipping them).
|
||||
matrix_prometheus_nginxlog_exporter_restart_necessary: false
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 133 KiB |
@@ -1,3 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 126 KiB |
@@ -1,3 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,25 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2023 - 2024 Slavi Pantaleev
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-prometheus-nginxlog-exporter
|
||||
- install-all
|
||||
- install-prometheus-nginxlog-exporter
|
||||
block:
|
||||
- when: matrix_prometheus_nginxlog_exporter_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_prometheus_nginxlog_exporter_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-prometheus-nginxlog-exporter
|
||||
block:
|
||||
- when: not matrix_prometheus_nginxlog_exporter_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
@@ -1,73 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2023 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2024 David Mehren
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Ensure matrix-prometheus-nginxlog-exporter image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_prometheus_nginxlog_exporter_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_prometheus_nginxlog_exporter_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_prometheus_nginxlog_exporter_docker_image_force_pull }}"
|
||||
register: matrix_prometheus_nginxlog_exporter_container_image_pull_result
|
||||
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||||
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||||
until: matrix_prometheus_nginxlog_exporter_container_image_pull_result is not failed
|
||||
|
||||
- name: Ensure prometheus-nginxlog-exporter paths exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: '0750'
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- "{{ matrix_prometheus_nginxlog_exporter_base_path }}"
|
||||
- "{{ matrix_prometheus_nginxlog_exporter_config_path }}"
|
||||
|
||||
- name: Ensure prometheus-nginxlog-exporter.yaml present
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/prometheus-nginxlog-exporter.yaml.j2"
|
||||
dest: "{{ matrix_prometheus_nginxlog_exporter_config_path }}/prometheus-nginxlog-exporter.yaml"
|
||||
mode: '0644'
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
register: matrix_prometheus_nginxlog_exporter_config_result
|
||||
|
||||
- name: Ensure prometheus-nginxlog-exporter support files installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/{{ item }}.j2"
|
||||
dest: "{{ matrix_prometheus_nginxlog_exporter_base_path }}/{{ item }}"
|
||||
mode: '0640'
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- labels
|
||||
register: matrix_prometheus_nginxlog_exporter_support_files_result
|
||||
|
||||
- name: Ensure prometheus-nginxlog-exporter container network is created
|
||||
community.general.docker_network:
|
||||
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
|
||||
name: "{{ matrix_prometheus_nginxlog_exporter_container_network }}"
|
||||
driver: bridge
|
||||
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
|
||||
|
||||
- name: Ensure matrix-prometheus-nginxlog-exporter.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-prometheus-nginxlog-exporter.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus-nginxlog-exporter.service"
|
||||
mode: '0644'
|
||||
register: matrix_prometheus_nginxlog_exporter_systemd_service_result
|
||||
|
||||
- name: Determine whether matrix-prometheus-nginxlog-exporter needs a restart
|
||||
ansible.builtin.set_fact:
|
||||
matrix_prometheus_nginxlog_exporter_restart_necessary: >-
|
||||
{{
|
||||
matrix_prometheus_nginxlog_exporter_config_result.changed | default(false)
|
||||
or matrix_prometheus_nginxlog_exporter_support_files_result.changed | default(false)
|
||||
or matrix_prometheus_nginxlog_exporter_systemd_service_result.changed | default(false)
|
||||
or matrix_prometheus_nginxlog_exporter_container_image_pull_result.changed | default(false)
|
||||
}}
|
||||
@@ -1,30 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2023 - 2024 Slavi Pantaleev
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-prometheus-nginxlog-exporter service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus-nginxlog-exporter.service"
|
||||
register: matrix_prometheus_nginxlog_exporter_service_stat
|
||||
|
||||
- when: matrix_prometheus_nginxlog_exporter_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-prometheus-nginxlog-exporter is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-prometheus-nginxlog-exporter
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-prometheus-nginxlog-exporter.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-prometheus-nginxlog-exporter.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure matrix-prometheus-nginxlog-exporter path doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_prometheus_nginxlog_exporter_base_path }}"
|
||||
state: absent
|
||||
@@ -1,44 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2023 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2025 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: (Deprecation) Catch and report renamed prometheus-nginxlog-exporter settings
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Your configuration contains a variable, which now has a different name.
|
||||
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
|
||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||
with_items:
|
||||
- {'old': 'matrix_prometheus_nginxlog_exporter_container_hostname', 'new': 'matrix_prometheus_nginxlog_exporter_identifier'}
|
||||
- {'old': 'matrix_prometheus_nginxlog_exporter_docker_image_name_prefix', 'new': 'matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix'}
|
||||
|
||||
- name: Fail if docker image not available for arch
|
||||
ansible.builtin.fail:
|
||||
msg: >
|
||||
'prometheus-nginxlog-exporter' docker image is not available for your arch '{{ matrix_architecture }}'.
|
||||
|
||||
We currently do not support building an image using this playbook.
|
||||
|
||||
You can use a custom-build image by setting
|
||||
'matrix_prometheus_nginxlog_exporter_docker_image_arch_check_enabled: false'
|
||||
'matrix_prometheus_nginxlog_exporter_docker_image: path/to/docker/image:tag'
|
||||
|
||||
or disable 'prometheus-nginxlog-exporter' by setting
|
||||
'matrix_prometheus_nginxlog_exporter: false'
|
||||
|
||||
in vars.yml
|
||||
when: matrix_prometheus_nginxlog_exporter_docker_image_arch_check_enabled and matrix_architecture not in matrix_prometheus_nginxlog_exporter_docker_image_arch
|
||||
|
||||
- name: Fail if required prometheus-nginxlog-exporter settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
||||
with_items:
|
||||
- {'name': 'matrix_prometheus_nginxlog_exporter_metrics_proxying_hostname', when: "{{ matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled }}"}
|
||||
- {'name': 'matrix_prometheus_nginxlog_exporter_metrics_proxying_path_prefix', when: "{{ matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled }}"}
|
||||
- {'name': 'matrix_prometheus_nginxlog_exporter_container_network', when: true}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2023 Slavi Pantaleev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,42 +0,0 @@
|
||||
{#
|
||||
SPDX-FileCopyrightText: 2024 Slavi Pantaleev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#}
|
||||
|
||||
{% if matrix_prometheus_nginxlog_exporter_container_labels_traefik_enabled %}
|
||||
traefik.enable=true
|
||||
|
||||
{% if matrix_prometheus_nginxlog_exporter_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_docker_network }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.services.{{ matrix_prometheus_nginxlog_exporter_identifier }}.loadbalancer.server.port={{ matrix_prometheus_nginxlog_exporter_container_metrics_port }}
|
||||
|
||||
{% set middlewares = [] %}
|
||||
|
||||
{% if matrix_prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_enabled %}
|
||||
{% set middlewares = middlewares + [matrix_prometheus_nginxlog_exporter_identifier + '-basic-auth'] %}
|
||||
traefik.http.middlewares.{{ matrix_prometheus_nginxlog_exporter_identifier }}-basic-auth.basicauth.users={{ matrix_prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_users }}
|
||||
{% endif %}
|
||||
|
||||
{% set middlewares = middlewares + [matrix_prometheus_nginxlog_exporter_identifier + '-replacepath'] %}
|
||||
traefik.http.middlewares.{{ matrix_prometheus_nginxlog_exporter_identifier }}-replacepath.replacepath.path=/metrics
|
||||
|
||||
traefik.http.routers.{{ matrix_prometheus_nginxlog_exporter_identifier }}.rule={{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_rule }}
|
||||
|
||||
{% if middlewares | length > 0 %}
|
||||
traefik.http.routers.{{ matrix_prometheus_nginxlog_exporter_identifier }}.middlewares={{ middlewares | join(',') }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.{{ matrix_prometheus_nginxlog_exporter_identifier }}.service={{ matrix_prometheus_nginxlog_exporter_identifier }}
|
||||
traefik.http.routers.{{ matrix_prometheus_nginxlog_exporter_identifier }}.entrypoints={{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_entrypoints }}
|
||||
|
||||
|
||||
traefik.http.routers.{{ matrix_prometheus_nginxlog_exporter_identifier }}.tls={{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_tls | to_json }}
|
||||
{% if matrix_prometheus_nginxlog_exporter_container_labels_traefik_tls %}
|
||||
traefik.http.routers.{{ matrix_prometheus_nginxlog_exporter_identifier }}.tls.certResolver={{ matrix_prometheus_nginxlog_exporter_container_labels_traefik_tls_certResolver }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{{ matrix_prometheus_nginxlog_exporter_container_labels_additional_labels }}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,64 +0,0 @@
|
||||
{#
|
||||
SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2024 Slavi Pantaleev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#}
|
||||
|
||||
listen:
|
||||
port: {{ matrix_prometheus_nginxlog_exporter_container_metrics_port }}
|
||||
address: "0.0.0.0"
|
||||
metrics_endpoint: "/metrics"
|
||||
|
||||
namespaces:
|
||||
- name: matrix
|
||||
metrics_override:
|
||||
prefix: "myprefix"
|
||||
namespace_label: "namespace"
|
||||
format: "$log_source $server_name - $upstream_addr - $remote_addr - $remote_user [$time_local] $host \"$request\" $status \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\""
|
||||
# enable to print to console
|
||||
# print_log: true
|
||||
source:
|
||||
syslog:
|
||||
listen_address: "udp://0.0.0.0:{{ matrix_prometheus_nginxlog_exporter_container_syslog_port }}"
|
||||
# format options: "rfc3164" ,"rfc5424", "rfc6587", "auto"
|
||||
format: auto
|
||||
tags: {{ matrix_prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags | to_json }}
|
||||
relabel_configs:
|
||||
- target_label: request_uri
|
||||
from: request
|
||||
split: 2
|
||||
separator: ' '
|
||||
matches:
|
||||
- regexp: "^([^\\?]+)/(public|bundles|fonts|img|themes|vector-icons|element-icons|d|media).*"
|
||||
replacement: "$1/$2/"
|
||||
- regexp: "^([^\\?]+).*/rooms/.*/(event|read_markers|messages|receipt|state|typing|members).*"
|
||||
replacement: "$1/rooms/:roomid:/$2"
|
||||
- regexp: "^([^\\?]+).*/(r0|v3)/(sync|pushers|keys|devices|download|sendtodevice).*"
|
||||
replacement: "$1/:v:/$3"
|
||||
- regexp: "^([^\\?]+).*/rooms/(.*)/send/(.*)"
|
||||
replacement: "$1/rooms/:roomid:/send/:command:/:id:"
|
||||
- regexp: "^([^\\?]+).*/client/unstable/.*"
|
||||
replacement: "$1/client/unstable/:matrixspec:"
|
||||
- regexp: "^([^\\?]+).*/presence/.*"
|
||||
replacement: "$1/presence/:userid:"
|
||||
- regexp: "^([^\\?]+).*/user/.*"
|
||||
replacement: "$1/user/:userid:"
|
||||
- regexp: "^([^\\?]+).*/profile/.*"
|
||||
replacement: "$1/profile/:userid:"
|
||||
- regexp: "^([^\\?]+).*/directory/room/.*"
|
||||
replacement: "$1/directory/room/:roomid:"
|
||||
- regexp: "^([^\\?]+).*/thumbnail/.*"
|
||||
replacement: "$1/thumbnail/:domain:/:mxid:"
|
||||
- regexp: "^([^\\?]+)(.*)"
|
||||
replacement: "$1"
|
||||
- target_label: remote_addr
|
||||
from: remote_addr
|
||||
- target_label: server_name
|
||||
from: server_name
|
||||
- target_label: http_x_forwarded_for
|
||||
from: http_x_forwarded_for
|
||||
- target_label: request_host
|
||||
from: host
|
||||
- target_label: log_source
|
||||
from: log_source
|
||||
@@ -1,54 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
[Unit]
|
||||
Description=prometheus-nginxlog-exporteer ({{ matrix_prometheus_nginxlog_exporter_identifier }})
|
||||
{% for service in matrix_prometheus_nginxlog_exporter_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_prometheus_nginxlog_exporter_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ matrix_prometheus_nginxlog_exporter_identifier }} 2>/dev/null || true'
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_prometheus_nginxlog_exporter_identifier }} 2>/dev/null || true'
|
||||
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--rm \
|
||||
--name={{ matrix_prometheus_nginxlog_exporter_identifier }} \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--read-only \
|
||||
--network={{ matrix_prometheus_nginxlog_exporter_container_network }} \
|
||||
{% if matrix_prometheus_nginxlog_exporter_container_http_host_bind_port %}
|
||||
-p {{ matrix_prometheus_nginxlog_exporter_container_http_host_bind_port }}:{{ matrix_prometheus_nginxlog_exporter_container_metrics_port }} \
|
||||
{% endif %}
|
||||
{% if matrix_prometheus_nginxlog_exporter_container_syslog_host_bind_port %}
|
||||
-p {{ matrix_prometheus_nginxlog_exporter_container_syslog_host_bind_port }}:{{ matrix_prometheus_nginxlog_exporter_container_syslog_port }}/udp \
|
||||
{% endif %}
|
||||
--mount type=bind,src={{ matrix_prometheus_nginxlog_exporter_config_path }},dst=/etc/prometheus-nginxlog-exporter \
|
||||
--label-file={{ matrix_prometheus_nginxlog_exporter_base_path }}/labels \
|
||||
{% for arg in matrix_prometheus_nginxlog_exporter_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_prometheus_nginxlog_exporter_docker_image }} \
|
||||
-config-file /etc/prometheus-nginxlog-exporter/prometheus-nginxlog-exporter.yaml
|
||||
|
||||
{% for network in matrix_prometheus_nginxlog_exporter_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_prometheus_nginxlog_exporter_identifier }}
|
||||
{% endfor %}
|
||||
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_prometheus_nginxlog_exporter_identifier }}
|
||||
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ matrix_prometheus_nginxlog_exporter_identifier }} 2>/dev/null || true'
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_prometheus_nginxlog_exporter_identifier }} 2>/dev/null || true'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier={{ matrix_prometheus_nginxlog_exporter_identifier }}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,4 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2023 - 2025 Slavi Pantaleev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -4,6 +4,8 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
# Controls if (`matrix_prometheus_nginxlog_exporter` -> `prometheus_nginxlog_exporter`) validation will run.
|
||||
matrix_playbook_migration_matrix_prometheus_nginxlog_exporter_migration_validation_enabled: true
|
||||
|
||||
# Controls if (`matrix_prometheus_node_exporter` -> `prometheus_node_exporter`) validation will run.
|
||||
matrix_playbook_migration_matrix_prometheus_node_exporter_migration_validation_enabled: true
|
||||
|
||||
@@ -95,6 +95,16 @@
|
||||
- {'old': 'hydrogen_docker_image_registry_prefix_upstream', 'new': 'hydrogen_container_image_registry_prefix_upstream'}
|
||||
- {'old': 'hydrogen_docker_image_registry_prefix_upstream_default', 'new': 'hydrogen_container_image_registry_prefix_upstream_default'}
|
||||
|
||||
- {'old': 'prometheus_nginxlog_exporter_docker_image', 'new': 'prometheus_nginxlog_exporter_container_image'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_docker_image_registry_prefix', 'new': 'prometheus_nginxlog_exporter_container_image_registry_prefix'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream', 'new': 'prometheus_nginxlog_exporter_container_image_registry_prefix_upstream'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_docker_image_registry_prefix_upstream_default', 'new': 'prometheus_nginxlog_exporter_container_image_registry_prefix_upstream_default'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_docker_image_arch_check_enabled', 'new': 'prometheus_nginxlog_exporter_container_image_arch_check_enabled'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_metrics_proxying_enabled', 'new': 'prometheus_nginxlog_exporter_container_labels_traefik_enabled'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_metrics_proxying_hostname', 'new': 'prometheus_nginxlog_exporter_container_labels_traefik_hostname'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_metrics_proxying_path_prefix', 'new': 'prometheus_nginxlog_exporter_container_labels_traefik_path_prefix'}
|
||||
- {'old': 'prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_custom', 'new': 'prometheus_nginxlog_exporter_config_namespaces_source_tags_custom'}
|
||||
|
||||
- name: (Deprecation) Catch and report matrix_postgres variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
@@ -124,6 +134,25 @@
|
||||
The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^matrix_mailer_.+', wantlist=True) | join(', ') }}
|
||||
when: "lookup('ansible.builtin.varnames', '^matrix_mailer_.+', wantlist=True) | length > 0"
|
||||
|
||||
- when: matrix_playbook_migration_matrix_prometheus_nginxlog_exporter_migration_validation_enabled | bool
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_playbook_migration_matrix_prometheus_nginxlog_exporter_migration_vars: |-
|
||||
{{ lookup('ansible.builtin.varnames', '^matrix_prometheus_nginxlog_exporter_.+', wantlist=True) }}
|
||||
|
||||
- name: (Deprecation) Catch and report matrix_prometheus_nginxlog_exporter variables
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-prometheus-nginxlog-exporter role that used to be part of this playbook has been replaced by https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-nginxlog-exporter.
|
||||
The new role is compatible with the old one, but uses different names for its variables.
|
||||
|
||||
Please rename all variables (`matrix_prometheus_nginxlog_exporter_` -> `prometheus_nginxlog_exporter_`) on your configuration file (vars.yml).
|
||||
|
||||
After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.
|
||||
|
||||
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_matrix_prometheus_nginxlog_exporter_migration_vars | join(', ') }}
|
||||
when: "matrix_playbook_migration_matrix_prometheus_nginxlog_exporter_migration_vars | length > 0"
|
||||
|
||||
- when: matrix_playbook_migration_matrix_prometheus_node_exporter_migration_validation_enabled | bool
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
- custom/matrix-continuwuity
|
||||
- custom/matrix-synapse-admin
|
||||
- custom/matrix-synapse-usage-exporter
|
||||
- galaxy/prometheus_nginxlog_exporter
|
||||
- galaxy/prometheus_node_exporter
|
||||
- galaxy/prometheus_postgres_exporter
|
||||
- custom/matrix-prometheus-nginxlog-exporter
|
||||
- galaxy/prometheus
|
||||
- galaxy/grafana
|
||||
- custom/matrix-prometheus-services-connect
|
||||
|
||||
Reference in New Issue
Block a user