service:prometheus
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версия | ||
service:prometheus [28.06.2024 12:38] – [Мониторинг хоста] viacheslav | service:prometheus [17.08.2024 07:34] (текущий) – [Конфиг] viacheslav | ||
---|---|---|---|
Строка 93: | Строка 93: | ||
__meta_kubernetes_pod_annotation_prometheus_io_path | __meta_kubernetes_pod_annotation_prometheus_io_path | ||
</ | </ | ||
- | , поэтому их заменяют на что-то более короткое и удобное, | + | , поэтому их заменяют на что-то более короткое и удобное, |
Тут для подов нужно задать аннотации | Тут для подов нужно задать аннотации | ||
Строка 143: | Строка 143: | ||
https:// | https:// | ||
+ | ===== Мониторинг SMART ===== | ||
+ | Поставить smartctl-exporter для экспорта метрик. Docker-compose: | ||
+ | <code yaml> | ||
+ | smartctl-exporter: | ||
+ | image: prometheuscommunity/ | ||
+ | container_name: | ||
+ | privileged: true | ||
+ | user: root | ||
+ | </ | ||
+ | |||
+ | Внести в prometheus.yml | ||
+ | <code yaml> | ||
+ | - job_name: ' | ||
+ | metrics_path: | ||
+ | static_configs: | ||
+ | - targets: [' | ||
+ | </ | ||
+ | https:// | ||
+ | https:// | ||
+ | |||
+ | Метрики начинаются на '' | ||
+ | < | ||
+ | {__name__=~" | ||
+ | </ | ||
===== Мониторинг nginx ===== | ===== Мониторинг nginx ===== | ||
Для nginx нужно включить там метрики '' | Для nginx нужно включить там метрики '' | ||
Строка 166: | Строка 190: | ||
} | } | ||
</ | </ | ||
+ | |||
Dockerfile | Dockerfile | ||
<file bash nginx/ | <file bash nginx/ | ||
Строка 232: | Строка 257: | ||
- targets: [' | - targets: [' | ||
</ | </ | ||
+ | |||
+ | Как выглядит страница '' | ||
+ | < | ||
+ | Active connections: | ||
+ | server accepts handled requests | ||
+ | 26 26 14840 | ||
+ | Reading: 0 Writing: 1 Waiting: 3 | ||
+ | </ | ||
+ | Страница '' | ||
+ | < | ||
+ | # HELP nginx_connections_accepted Accepted client connections | ||
+ | # TYPE nginx_connections_accepted counter | ||
+ | nginx_connections_accepted 26 | ||
+ | # HELP nginx_connections_active Active client connections | ||
+ | # TYPE nginx_connections_active gauge | ||
+ | nginx_connections_active 3 | ||
+ | # HELP nginx_connections_handled Handled client connections | ||
+ | # TYPE nginx_connections_handled counter | ||
+ | nginx_connections_handled 26 | ||
+ | # HELP nginx_connections_reading Connections where NGINX is reading the request header | ||
+ | # TYPE nginx_connections_reading gauge | ||
+ | nginx_connections_reading 0 | ||
+ | # HELP nginx_connections_waiting Idle client connections | ||
+ | # TYPE nginx_connections_waiting gauge | ||
+ | nginx_connections_waiting 2 | ||
+ | # HELP nginx_connections_writing Connections where NGINX is writing the response back to the client | ||
+ | # TYPE nginx_connections_writing gauge | ||
+ | nginx_connections_writing 1 | ||
+ | # HELP nginx_exporter_build_info A metric with a constant ' | ||
+ | # TYPE nginx_exporter_build_info gauge | ||
+ | nginx_exporter_build_info{branch=" | ||
+ | # HELP nginx_http_requests_total Total http requests | ||
+ | # TYPE nginx_http_requests_total counter | ||
+ | nginx_http_requests_total 14995 | ||
+ | # HELP nginx_up Status of the last metric scrape | ||
+ | # TYPE nginx_up gauge | ||
+ | nginx_up 1 | ||
+ | </ | ||
+ | |||
+ | Литература: | ||
+ | https:// | ||
+ | https:// | ||
+ | [[https:// | ||
===== Howto ===== | ===== Howto ===== | ||
==== unixtime to datetime ==== | ==== unixtime to datetime ==== | ||
Значение * 1000, выставить формат отображения Datetime (Field -> Unit -> Datetime). | Значение * 1000, выставить формат отображения Datetime (Field -> Unit -> Datetime). | ||
service/prometheus.1719578302.txt.gz · Последнее изменение: 30.07.2024 19:20 (внешнее изменение)