Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
technique:adminsys:monitoring:collect:service_metrics [2022/09/23 10:19] – modification externe 127.0.0.1 | technique:adminsys:monitoring:collect:service_metrics [2023/12/29 17:45] (Version actuelle) – Ajout procédure mots de passe limaanto | ||
---|---|---|---|
Ligne 9: | Ligne 9: | ||
Du côté de Traefik, on va simplement se baser sur le middleware [[https:// | Du côté de Traefik, on va simplement se baser sur le middleware [[https:// | ||
- | Prenons l' | + | Prenons l' |
- | Dans notre cas, un exporter Prometheus écoute sous le chemin ''/ | + | Dans notre cas, un exporter Prometheus écoute sous le chemin ''/ |
```yaml | ```yaml | ||
traefik.enable: | traefik.enable: | ||
- | traefik.http.routers.codimd-app.entrypoints: | + | traefik.http.routers.hedgedoc-app.entrypoints: |
- | traefik.http.routers.codimd-app.rule: Host(`md.picasoft.net`) | + | traefik.http.routers.hedgedoc-app.rule: Host(`md.picasoft.net`) |
- | traefik.http.routers.codimd-app.service: | + | traefik.http.routers.hedgedoc-app.service: |
- | traefik.http.routers.codimd-metrics.entrypoints: | + | traefik.http.routers.hedgedoc-metrics.entrypoints: |
- | traefik.http.routers.codimd-metrics.rule: | + | traefik.http.routers.hedgedoc-metrics.rule: |
- | traefik.http.routers.codimd-metrics.service: | + | traefik.http.routers.hedgedoc-metrics.service: |
- | traefik.http.routers.codimd-metrics.middlewares: | + | traefik.http.routers.hedgedoc-metrics.middlewares: |
- | traefik.http.middlewares.codimd-metrics-auth.basicauth.users: | + | traefik.http.middlewares.hedgedoc-metrics-auth.basicauth.users: |
- | traefik.http.services.codimd-app.loadbalancer.server.port: | + | traefik.http.services.hedgedoc-app.loadbalancer.server.port: |
``` | ``` | ||
Ligne 38: | Ligne 38: | ||
```yaml | ```yaml | ||
- | - job_name: | + | - job_name: |
- | metrics_path: | + | metrics_path: |
scheme: " | scheme: " | ||
basic_auth: | basic_auth: | ||
- | username: | + | username: |
password: monpassword | password: monpassword | ||
static_configs: | static_configs: | ||
Ligne 52: | Ligne 52: | ||
```yaml | ```yaml | ||
- | - job_name: | + | - job_name: |
- | metrics_path: | + | metrics_path: |
scheme: " | scheme: " | ||
basic_auth: | basic_auth: | ||
- | username: "%{CODIMD_METRICS_USER}" | + | username: "%{HEDGEDOC_METRICS_USER}" |
- | password: "%{CODIMD_METRICS_PASSWORD}" | + | password: "%{HEDGEDOC_METRICS_PASSWORD}" |
static_configs: | static_configs: | ||
- targets: | - targets: | ||
Ligne 64: | Ligne 64: | ||
Il ne reste plus que à fournir les 2 variables d' | Il ne reste plus que à fournir les 2 variables d' | ||
+ | |||
+ | ## Génération du mot de passe | ||
+ | |||
+ | Après avoir créé l' | ||
+ | |||
+ | Ce mot de passe peut être donné en clair côté monitoring via la variable d’environnement `HEDGEDOC_METRICS_PASSWORD`. Cependant, traefik s' | ||
+ | Pour cela on exécutera la commande suivante | ||
+ | |||
+ | ```sh | ||
+ | htpasswd -nb $HEDGEDOC_METRICS_USER $HEDGEDOC_METRICS_PASSWORD | ||
+ | ``` | ||
+ | |||
+ | Dont la sortie peut être mise dans la variable d' |