Skip to content

Commit

Permalink
feat: Allow to expose metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
moan0s committed Oct 2, 2023
1 parent 961f0c8 commit 265d9e9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,14 @@ authentik_worker_container_network: '{{ authentik_container_network }}'
authentik_worker_container_additional_networks: []

authentik_worker_variables_additional_variables: ''

################
## Monitoring ##
################

authentik_metrics_enabled: false
authentik_metrics_path_prefix: '/metrics'
authentik_metrics_container_labels_traefik_rule: "Host(`{{ authentik_hostname }}`) && PathPrefix(`{{ authentik_metrics_path_prefix | quote }}`)"
authentik_metrics_container_labels_traefik_entrypoints: web-secure
authentik_metrics_container_labels_traefik_tls: "{{ authentik_metrics_container_labels_traefik_entrypoints != 'web' }}"
authentik_metrics_container_labels_traefik_tls_certResolver: default # noqa var-naming
12 changes: 12 additions & 0 deletions templates/labels.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,16 @@ traefik.http.routers.{{ authentik_server_identifier }}.tls.certResolver={{ authe
{% endif %}
traefik.http.services.{{ authentik_server_identifier }}.loadbalancer.server.port={{ authentik_container_http_port }}

{% if authentik_metrics_enabled %}
traefik.http.routers.{{ authentik_identifier }}-metrics.rule={{ authentik_metrics_container_labels_traefik_rule }}
traefik.http.routers.{{ authentik_identifier }}-metrics.service={{ authentik_identifier }}-metrics
traefik.http.routers.{{ authentik_identifier }}-metrics.entrypoints={{ authentik_metrics_container_labels_traefik_entrypoints }}
traefik.http.routers.{{ authentik_identifier }}-metrics.tls={{ authentik_metrics_container_labels_traefik_tls | to_json }}
{% if authentik_metrics_container_labels_traefik_tls %}
traefik.http.routers.{{ authentik_identifier }}-metrics.tls.certResolver={{ authentik_metrics_container_labels_traefik_tls_certResolver }}
{% endif %}

traefik.http.services.{{ authentik_identifier }}-metrics.loadbalancer.server.port=9300
{% endif %}

{{ authentik_container_labels_additional_labels }}

0 comments on commit 265d9e9

Please sign in to comment.