Просмотр исходного кода

Remove matrix-prometheus-nginxlog-exporter in favor of ansible-role-prometheus-nginxlog-exporter

Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
pull/4938/head
Suguru Hirahara 2 недель назад
Родитель
Сommit
df4027b0ab
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: E4F9743DAB4B7B75
17 измененных файлов: 0 добавлений и 3863 удалений
  1. +0
    -107
      roles/custom/matrix-prometheus-nginxlog-exporter/defaults/main.yml
  2. Двоичные данные
      roles/custom/matrix-prometheus-nginxlog-exporter/examples/grafana.png
  3. +0
    -3
      roles/custom/matrix-prometheus-nginxlog-exporter/examples/grafana.png.license
  4. Двоичные данные
      roles/custom/matrix-prometheus-nginxlog-exporter/examples/metrics.png
  5. +0
    -3
      roles/custom/matrix-prometheus-nginxlog-exporter/examples/metrics.png.license
  6. +0
    -25
      roles/custom/matrix-prometheus-nginxlog-exporter/tasks/main.yml
  7. +0
    -73
      roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_install.yml
  8. +0
    -30
      roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_uninstall.yml
  9. +0
    -42
      roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml
  10. +0
    -1705
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json
  11. +0
    -3
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json.license
  12. +0
    -42
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/labels.j2
  13. +0
    -1705
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json
  14. +0
    -3
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json.license
  15. +0
    -64
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/prometheus-nginxlog-exporter.yaml.j2
  16. +0
    -54
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/systemd/matrix-prometheus-nginxlog-exporter.service.j2
  17. +0
    -4
      roles/custom/matrix-prometheus-nginxlog-exporter/templates/systemd/matrix-prometheus-nginxlog-exporter.service.j2.license

+ 0
- 107
roles/custom/matrix-prometheus-nginxlog-exporter/defaults/main.yml Просмотреть файл

@@ -1,107 +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/

prometheus_nginxlog_exporter_enabled: true

prometheus_nginxlog_exporter_identifier: ''

# You don't need to configure a hostname and path prefix if you're not exposing this.
prometheus_nginxlog_exporter_hostname: ''
prometheus_nginxlog_exporter_path_prefix: "/metrics/nginxlog"

# renovate: datasource=docker depName=ghcr.io/martin-helmich/prometheus-nginxlog-exporter/exporter
prometheus_nginxlog_exporter_version: v1.10.0

prometheus_nginxlog_exporter_container_metrics_port: '4040'
prometheus_nginxlog_exporter_container_syslog_port: '6514'

prometheus_nginxlog_exporter_container_image_arch: ['amd64', 'arm64']
prometheus_nginxlog_exporter_container_image: "{{ prometheus_nginxlog_exporter_container_image_registry_prefix }}martin-helmich/prometheus-nginxlog-exporter/exporter:{{ prometheus_nginxlog_exporter_container_image_tag }}"
prometheus_nginxlog_exporter_container_image_registry_prefix: "{{ prometheus_nginxlog_exporter_container_image_registry_prefix_upstream }}"
prometheus_nginxlog_exporter_container_image_registry_prefix_upstream_default: "ghcr.io/"
prometheus_nginxlog_exporter_container_image_tag: "{{ 'latest' if prometheus_nginxlog_exporter_version == 'master' else prometheus_nginxlog_exporter_version }}-{{ matrix_architecture }}"
prometheus_nginxlog_exporter_container_image_force_pull: "{{ prometheus_nginxlog_exporter_container_image.endswith(':latest') }}"
prometheus_nginxlog_exporter_container_image_arch_check_enabled: true

# 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.
prometheus_nginxlog_exporter_dashboard_urls: []

prometheus_nginxlog_exporter_config_path: "{{ prometheus_nginxlog_exporter_base_path }}/config"

prometheus_nginxlog_exporter_container_network: "{{ prometheus_nginxlog_exporter_identifier }}"

prometheus_nginxlog_exporter_container_additional_networks: "{{ prometheus_nginxlog_exporter_container_additional_networks_auto + prometheus_nginxlog_exporter_container_additional_networks_custom }}"
prometheus_nginxlog_exporter_container_additional_networks_auto: []
prometheus_nginxlog_exporter_container_additional_networks_custom: []

# 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 `prometheus_nginxlog_exporter_container_labels_additional_labels`.
prometheus_nginxlog_exporter_container_labels_traefik_enabled: "{{ true if prometheus_nginxlog_exporter_hostname else false }}"
prometheus_nginxlog_exporter_container_labels_traefik_docker_network: "{{ prometheus_nginxlog_exporter_container_network }}"
prometheus_nginxlog_exporter_container_labels_traefik_hostname: "{{ prometheus_nginxlog_exporter_hostname }}"
# The path prefix must either be `/` or not end with a slash (e.g. `/metrics`).
prometheus_nginxlog_exporter_container_labels_traefik_path_prefix: "{{ prometheus_nginxlog_exporter_path_prefix }}"
prometheus_nginxlog_exporter_container_labels_traefik_rule: "Host(`{{ prometheus_nginxlog_exporter_container_labels_traefik_hostname }}`) && PathPrefix(`{{ prometheus_nginxlog_exporter_container_labels_traefik_path_prefix }}`)"
prometheus_nginxlog_exporter_container_labels_traefik_entrypoints: web-secure
prometheus_nginxlog_exporter_container_labels_traefik_tls: "{{ prometheus_nginxlog_exporter_container_labels_traefik_entrypoints != 'web' }}"
prometheus_nginxlog_exporter_container_labels_traefik_tls_certResolver: default # noqa var-naming
prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_enabled: false
# See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_users: ''

# 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:
# prometheus_nginxlog_exporter_container_labels_additional_labels: |
# my.label=1
# another.label="here"
prometheus_nginxlog_exporter_container_labels_additional_labels: ''

# A list of extra docker arguments to pass to the container
prometheus_nginxlog_exporter_container_extra_arguments: []

# List of systemd services that matrix-prometheus_nginxlog_exporter.service depends on
prometheus_nginxlog_exporter_systemd_required_services_list: "{{ prometheus_nginxlog_exporter_systemd_required_services_list_default + prometheus_nginxlog_exporter_systemd_required_services_list_auto + prometheus_nginxlog_exporter_systemd_required_services_list_custom }}"
prometheus_nginxlog_exporter_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
prometheus_nginxlog_exporter_systemd_required_services_list_auto: []
prometheus_nginxlog_exporter_systemd_required_services_list_custom: []

# List of systemd services that matrix-prometheus_nginxlog_exporter.service wants
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.
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!
prometheus_nginxlog_exporter_container_syslog_host_bind_port: ''

prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags: "{{ prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto + prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_custom }}"
prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_auto: []
prometheus_nginxlog_exporter_config_namespaces_matrix_source_tags_custom: []

# 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).
prometheus_nginxlog_exporter_restart_necessary: false

Двоичные данные
roles/custom/matrix-prometheus-nginxlog-exporter/examples/grafana.png Просмотреть файл

До После
Ширина: 921  |  Высота: 953  |  Размер: 133 KiB

+ 0
- 3
roles/custom/matrix-prometheus-nginxlog-exporter/examples/grafana.png.license Просмотреть файл

@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2022 MDAD project contributors

SPDX-License-Identifier: AGPL-3.0-or-later

Двоичные данные
roles/custom/matrix-prometheus-nginxlog-exporter/examples/metrics.png Просмотреть файл

До После
Ширина: 921  |  Высота: 331  |  Размер: 126 KiB

+ 0
- 3
roles/custom/matrix-prometheus-nginxlog-exporter/examples/metrics.png.license Просмотреть файл

@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2022 MDAD project contributors

SPDX-License-Identifier: AGPL-3.0-or-later

+ 0
- 25
roles/custom/matrix-prometheus-nginxlog-exporter/tasks/main.yml Просмотреть файл

@@ -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: prometheus_nginxlog_exporter_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"

- when: 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 prometheus_nginxlog_exporter_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"

+ 0
- 73
roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_install.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 prometheus-nginxlog-exporter image is pulled
community.docker.docker_image:
name: "{{ prometheus_nginxlog_exporter_container_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ prometheus_nginxlog_exporter_container_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 prometheus_nginxlog_exporter_container_image_force_pull }}"
register: prometheus_nginxlog_exporter_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: 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:
- "{{ prometheus_nginxlog_exporter_base_path }}"
- "{{ 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: "{{ prometheus_nginxlog_exporter_config_path }}/prometheus-nginxlog-exporter.yaml"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: prometheus_nginxlog_exporter_config_result

- name: Ensure prometheus-nginxlog-exporter support files installed
ansible.builtin.template:
src: "{{ role_path }}/templates/{{ item }}.j2"
dest: "{{ prometheus_nginxlog_exporter_base_path }}/{{ item }}"
mode: '0640'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- labels
register: 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: "{{ prometheus_nginxlog_exporter_container_network }}"
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"

- name: Ensure prometheus-nginxlog-exporter.service installed
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/prometheus-nginxlog-exporter.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/prometheus-nginxlog-exporter.service"
mode: '0644'
register: prometheus_nginxlog_exporter_systemd_service_result

- name: Determine whether prometheus-nginxlog-exporter needs a restart
ansible.builtin.set_fact:
prometheus_nginxlog_exporter_restart_necessary: >-
{{
prometheus_nginxlog_exporter_config_result.changed | default(false)
or prometheus_nginxlog_exporter_support_files_result.changed | default(false)
or prometheus_nginxlog_exporter_systemd_service_result.changed | default(false)
or prometheus_nginxlog_exporter_container_image_pull_result.changed | default(false)
}}

+ 0
- 30
roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_uninstall.yml Просмотреть файл

@@ -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 prometheus-nginxlog-exporter service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/prometheus-nginxlog-exporter.service"
register: prometheus_nginxlog_exporter_service_stat

- when: prometheus_nginxlog_exporter_service_stat.stat.exists | bool
block:
- name: Ensure prometheus-nginxlog-exporter is stopped
ansible.builtin.service:
name: prometheus-nginxlog-exporter
state: stopped
enabled: false
daemon_reload: true

- name: Ensure prometheus-nginxlog-exporter.service doesn't exist
ansible.builtin.file:
path: "{{ devture_systemd_docker_base_systemd_path }}/prometheus-nginxlog-exporter.service"
state: absent

- name: Ensure prometheus-nginxlog-exporter path doesn't exist
ansible.builtin.file:
path: "{{ prometheus_nginxlog_exporter_base_path }}"
state: absent

+ 0
- 42
roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml Просмотреть файл

@@ -1,42 +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': 'prometheus_nginxlog_exporter_container_hostname', 'new': 'prometheus_nginxlog_exporter_identifier'}
- {'old': 'prometheus_nginxlog_exporter_container_image_name_prefix', 'new': 'prometheus_nginxlog_exporter_container_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
'prometheus_nginxlog_exporter_container_image_arch_check_enabled: false'
'prometheus_nginxlog_exporter_container_image: path/to/docker/image:tag'

or disable 'prometheus-nginxlog-exporter' by setting
'prometheus_nginxlog_exporter: false'

in vars.yml
when: prometheus_nginxlog_exporter_container_image_arch_check_enabled and matrix_architecture not in prometheus_nginxlog_exporter_container_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': 'prometheus_nginxlog_exporter_container_network', when: true}

+ 0
- 1705
roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 0
- 3
roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json.license Просмотреть файл

@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2023 Slavi Pantaleev

SPDX-License-Identifier: AGPL-3.0-or-later

+ 0
- 42
roles/custom/matrix-prometheus-nginxlog-exporter/templates/labels.j2 Просмотреть файл

@@ -1,42 +0,0 @@
{#
SPDX-FileCopyrightText: 2024 Slavi Pantaleev

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{% if prometheus_nginxlog_exporter_container_labels_traefik_enabled %}
traefik.enable=true

{% if prometheus_nginxlog_exporter_container_labels_traefik_docker_network %}
traefik.docker.network={{ prometheus_nginxlog_exporter_container_labels_traefik_docker_network }}
{% endif %}

traefik.http.services.{{ prometheus_nginxlog_exporter_identifier }}.loadbalancer.server.port={{ prometheus_nginxlog_exporter_container_metrics_port }}

{% set middlewares = [] %}

{% if prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_enabled %}
{% set middlewares = middlewares + [prometheus_nginxlog_exporter_identifier + '-basic-auth'] %}
traefik.http.middlewares.{{ prometheus_nginxlog_exporter_identifier }}-basic-auth.basicauth.users={{ prometheus_nginxlog_exporter_container_labels_metrics_middleware_basic_auth_users }}
{% endif %}

{% set middlewares = middlewares + [prometheus_nginxlog_exporter_identifier + '-replacepath'] %}
traefik.http.middlewares.{{ prometheus_nginxlog_exporter_identifier }}-replacepath.replacepath.path=/metrics

traefik.http.routers.{{ prometheus_nginxlog_exporter_identifier }}.rule={{ prometheus_nginxlog_exporter_container_labels_traefik_rule }}

{% if middlewares | length > 0 %}
traefik.http.routers.{{ prometheus_nginxlog_exporter_identifier }}.middlewares={{ middlewares | join(',') }}
{% endif %}

traefik.http.routers.{{ prometheus_nginxlog_exporter_identifier }}.service={{ prometheus_nginxlog_exporter_identifier }}
traefik.http.routers.{{ prometheus_nginxlog_exporter_identifier }}.entrypoints={{ prometheus_nginxlog_exporter_container_labels_traefik_entrypoints }}


traefik.http.routers.{{ prometheus_nginxlog_exporter_identifier }}.tls={{ prometheus_nginxlog_exporter_container_labels_traefik_tls | to_json }}
{% if prometheus_nginxlog_exporter_container_labels_traefik_tls %}
traefik.http.routers.{{ prometheus_nginxlog_exporter_identifier }}.tls.certResolver={{ prometheus_nginxlog_exporter_container_labels_traefik_tls_certResolver }}
{% endif %}
{% endif %}

{{ prometheus_nginxlog_exporter_container_labels_additional_labels }}

+ 0
- 1705
roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 0
- 3
roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json.license Просмотреть файл

@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2022 MDAD project contributors

SPDX-License-Identifier: AGPL-3.0-or-later

+ 0
- 64
roles/custom/matrix-prometheus-nginxlog-exporter/templates/prometheus-nginxlog-exporter.yaml.j2 Просмотреть файл

@@ -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: {{ 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:{{ prometheus_nginxlog_exporter_container_syslog_port }}"
# format options: "rfc3164" ,"rfc5424", "rfc6587", "auto"
format: auto
tags: {{ 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

+ 0
- 54
roles/custom/matrix-prometheus-nginxlog-exporter/templates/systemd/matrix-prometheus-nginxlog-exporter.service.j2 Просмотреть файл

@@ -1,54 +0,0 @@
#jinja2: lstrip_blocks: True
[Unit]
Description=prometheus-nginxlog-exporteer ({{ prometheus_nginxlog_exporter_identifier }})
{% for service in prometheus_nginxlog_exporter_systemd_required_services_list %}
Requires={{ service }}
After={{ service }}
{% endfor %}
{% for service in 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 }} {{ 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 {{ prometheus_nginxlog_exporter_identifier }} 2>/dev/null || true'

ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--rm \
--name={{ prometheus_nginxlog_exporter_identifier }} \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--read-only \
--network={{ prometheus_nginxlog_exporter_container_network }} \
{% if prometheus_nginxlog_exporter_container_http_host_bind_port %}
-p {{ prometheus_nginxlog_exporter_container_http_host_bind_port }}:{{ prometheus_nginxlog_exporter_container_metrics_port }} \
{% endif %}
{% if prometheus_nginxlog_exporter_container_syslog_host_bind_port %}
-p {{ prometheus_nginxlog_exporter_container_syslog_host_bind_port }}:{{ prometheus_nginxlog_exporter_container_syslog_port }}/udp \
{% endif %}
--mount type=bind,src={{ prometheus_nginxlog_exporter_config_path }},dst=/etc/prometheus-nginxlog-exporter \
--label-file={{ prometheus_nginxlog_exporter_base_path }}/labels \
{% for arg in prometheus_nginxlog_exporter_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ prometheus_nginxlog_exporter_container_image }} \
-config-file /etc/prometheus-nginxlog-exporter/prometheus-nginxlog-exporter.yaml

{% for network in prometheus_nginxlog_exporter_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ prometheus_nginxlog_exporter_identifier }}
{% endfor %}

ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ 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 }} {{ 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 {{ prometheus_nginxlog_exporter_identifier }} 2>/dev/null || true'
Restart=always
RestartSec=30
SyslogIdentifier={{ prometheus_nginxlog_exporter_identifier }}

[Install]
WantedBy=multi-user.target

+ 0
- 4
roles/custom/matrix-prometheus-nginxlog-exporter/templates/systemd/matrix-prometheus-nginxlog-exporter.service.j2.license Просмотреть файл

@@ -1,4 +0,0 @@
SPDX-FileCopyrightText: 2022 MDAD project contributors
SPDX-FileCopyrightText: 2023 - 2025 Slavi Pantaleev

SPDX-License-Identifier: AGPL-3.0-or-later

Загрузка…
Отмена
Сохранить