prom
This commit is contained in:
59
tp2.md
59
tp2.md
@@ -73,6 +73,63 @@ debit_sortie->Set(_digital[IN_FLOW_IN].dvalue);
|
||||
|
||||
### Ajouter un conteneur pour Prometheus
|
||||
|
||||
### Ajouter un conteneur pour Grafanas
|
||||
Créer un fichier de configuration
|
||||
|
||||
```json
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
scrape_interval: 1m
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: 'apps_dynamiques'
|
||||
file_sd_configs:
|
||||
- files:
|
||||
- /etc/prometheus/targets/*.yml
|
||||
|
||||
- job_name: docker
|
||||
docker_sd_configs:
|
||||
- host: unix:///var/run/docker.sock
|
||||
refresh_interval: 15s
|
||||
filters:
|
||||
- name: label
|
||||
values: ['prometheus=true']
|
||||
relabel_configs:
|
||||
- source_labels: ['__meta_docker_container_name']
|
||||
regex: '/(.*)'
|
||||
target_label: 'container'
|
||||
```
|
||||
|
||||
```shell
|
||||
docker run --detach --name prometheus \
|
||||
--network tp_net \
|
||||
-p "9090:9090" \
|
||||
-v prometheus:/prometheus \
|
||||
-v ./prometheus.yml:/etc/prometheus/prometheus.yml \
|
||||
-v ./prometheus:/etc/prometheus/targets \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-l "caddy=prometheus.localhost" \
|
||||
-l "caddy.reverse_proxy={{upstreams 9090}}" \
|
||||
-l "caddy.tls=internal" \
|
||||
prom/prometheus:v3.8.0
|
||||
```
|
||||
|
||||
### Ajouter un conteneur pour Grafana
|
||||
|
||||
```shell
|
||||
docker run --detach --name grafana \
|
||||
--network tp_net \
|
||||
-e "GF_SECURITY_ADMIN_USER=admin" \
|
||||
-e "GF_SECURITY_ADMIN_PASSWORD=geii2025" \
|
||||
-e "GF_USERS_ALLOW_SIGN_UP=false" \
|
||||
-e "GF_USERS_DEFAULT_THEME=system" \
|
||||
--label "caddy=grafana.localhost" \
|
||||
--label "caddy.reverse_proxy={{upstreams 3000}}" \
|
||||
--label "caddy.tls=internal" \
|
||||
grafana/grafana:12.1
|
||||
```
|
||||
|
||||
### Ajouter un conteneur pour Mailpits
|
||||
|
||||
Reference in New Issue
Block a user