prometheus 4

[K8s, Grafana] Loki 데이터량 확인 및 유지기간 설정 방법 확인(2.6.1)

Loki(2.6.1) 데이터량 확인 및 유지기간 설정 방법 확인1. 데이터량 확인 방법Prometheus 에서 아래 metric을 쿼리loki_ingester_chunk_stored_bytes_total백분율 등의 형태로도 쿼리 가능.(sum(loki_ingester_chunk_stored_bytes_total) / sum(node_filesystem_size_bytes{mountpoint="/home"}) ) * 1001) 시각화 시안퍼센트 게이지와 disk 크기 총량시계열 그래프텍스트2. 유지기간 설정1) 설정 방법: Loki compactor 설정compactor: index(로그들의 색인 파일)를 압축 / 삭제하는 역할.삭제 설정: retention_enabled: true.default는 fa..

[Prometheus] 적절한 scrape_interval을 찾아.. - Node exporter 코드 분석

목차Prometheus의 대략적인 구조 - pulling, exporter결론분석1. Prometheus의 구조 - exporter, pullingPrometheus 각종 exporter 들로부터 그들의 매트릭을 pull하여 저장한다. 그 주기는 scrape_config - rate_interval(이하 scrape interval) 을 참조한다. docker에 node-exporter, cadvisor-exporter 등의 이름으로 container 를 돌리고 있다면, 아래처럼 접속해서 prometheus 가 수집하는 매트릭을 확인해볼 수 있다.  http://node-exporter:9100/metrichttp://cadvisor-exporter:9100/metric그렇다면 이들 exporter들의 ..

[모니터링, k8s, Grafana, Prometheus] Prometheus 쿼리에 '$__rate_interval' 이 포함될 때 return 값이 없는 현상

상황Grafana 대시보드에서 Prometheus를 datasource로 사용하는 대시보드에서 metric들을 쿼리할 때, 그래프에 일부 값들이 표현되지 않았다.비교적 짧은 기간(5 ~ 10m) 을 쿼리할 때에만 해당 증상이 나타났다. 긴 기간을 쿼리할 때에는 정상 작동했다.추측했던 원인prometheus 의 버전 문제:[$__rate_interval]을 지원하지 않는 버전이지 않을까 추측함 -> 아니었다.원인Prometheus 의 scrape_interval 값이 grafana의 rate_interval(조회 기간에 따라 자동 생성됨)값에 비해 크다.Grafana 에서 rate_interval % 4가 Prometheus 의 scrape_interval 값 보다 작을 경우, 쿼리에 대한 결과값이 없다...

[k8s, 모니터링] grafana 와 cost-analyzer 의 helm chart 가 app-of-apps 구성에서 오류를 일으키는 현상.

k8s, 모니터링] grafana 와 cost-exploer 의 helm chart 가 app-of-apps 구성에서 오류를 일으키는 현상.환경helm Version:"v3.12.3"EKS 표준 설정 클러스터monitoring-app 이라는 app에 prometheus, grafana 등의 helm chart를 통합 관리. # chart.yamlappVersion: "1.16.0"dependencies:- name: "loki" condition: loki.enabled repository: "https://grafana.github.io/helm-charts" version: "^2.9.0"- name: "promtail" condition: promtail.enabled repository:..

TIL/기타 2024.10.15