mirror of
https://github.com/demostf/setup
synced 2026-06-04 00:54:07 +02:00
nginx metrics
This commit is contained in:
parent
d8d543cd95
commit
da8ed6a0e2
3 changed files with 47 additions and 2 deletions
|
|
@ -109,10 +109,18 @@ services:
|
||||||
- LOKI_PASSWORD=${LOKI_PASSWORD}
|
- LOKI_PASSWORD=${LOKI_PASSWORD}
|
||||||
command: -config.file=/etc/promtail/promtail.yml -config.expand-env=true
|
command: -config.file=/etc/promtail/promtail.yml -config.expand-env=true
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
image: ghcr.io/martin-helmich/prometheus-nginxlog-exporter/exporter:v1
|
||||||
|
networks:
|
||||||
|
- proxy-tier
|
||||||
|
volumes:
|
||||||
|
- logs:/logs:ro
|
||||||
|
- ./nginxlog.yaml:/nginxlog.yaml
|
||||||
|
command: -config-file=/nginxlog.yaml
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy-tier:
|
proxy-tier:
|
||||||
db-tier:
|
db-tier:
|
||||||
parser-tier:
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
logs:
|
logs:
|
||||||
|
|
|
||||||
37
nginxlog.yaml
Normal file
37
nginxlog.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"listen": {
|
||||||
|
"address": "0.0.0.0",
|
||||||
|
"metrics_endpoint": "/metrics",
|
||||||
|
"port": 80
|
||||||
|
},
|
||||||
|
"namespaces": [
|
||||||
|
{
|
||||||
|
"format": "$remote_addr $host - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" rt=$request_time uct=\"$upstream_connect_time\" uht=\"$upstream_header_time\" urt=\"$upstream_response_time\"",
|
||||||
|
"histogram_buckets": [
|
||||||
|
0.005,
|
||||||
|
0.01,
|
||||||
|
0.025,
|
||||||
|
0.05,
|
||||||
|
0.1,
|
||||||
|
0.25,
|
||||||
|
0.5,
|
||||||
|
1,
|
||||||
|
2.5,
|
||||||
|
5,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"name": "nginx",
|
||||||
|
"relabel_configs": [
|
||||||
|
{
|
||||||
|
"from": "host",
|
||||||
|
"target_label": "host"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": {
|
||||||
|
"files": [
|
||||||
|
"/logs/nginxlog.log"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -19,4 +19,4 @@ scrape_configs:
|
||||||
labels:
|
labels:
|
||||||
job: varlogs
|
job: varlogs
|
||||||
host: demos.tf
|
host: demos.tf
|
||||||
__path__: /logs/*log
|
__path__: /logs/access.log
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue