devops

    nats - prometheus 연동

    목적 nats -> prometheus -> grafana 구성으로 모니터링 환경을 구축 하려고 한다. 방법 nats와 prometheus 모니터링을 하기위해, nats 서버에 prometheus-nats-exporter를 설치 해야한다. nats와 nats-exporter 연동을 위해서는 nats-server 기동시 -m 옵션으로 모니터링 포트를 지정해야한다. nats-server -p 4222 -m 8222 nats-exporter를 기동한다. prometheus-nats-exporter -varz -jsz=all http://127.0.0.1:8222nats-exporter가 nats-server보다 먼저 기동되어서는 안된다. 8222 포트가 listen 된것을 확인하고, 기동해야 정상적으로 연동된..

    promethues 쿼리 몇 가지

    kubernetes에 prometheus & grafana로 구성하고, grafana 에서 사용한 prometheus 쿼리 몇가지 정리 합니다. 버전 Prometheus 2.26.0 Grafana 8.3.0 쿼리 Stat namespace 개수: count(kube_namespace_created) pvc 개수: count(kube_presistentvolumeclain_info) pod 개수: count(count by(pod)(container_spec_memory_reservation_limit_bytes{pod!=""})) container 개수: count(kube_pod_container_status_running{namespace!="/"}) Replica Rate: sum(kube_repl..