ããã«ã¡ã¯ã Necoãã¼ã ã®æ¢ 澤ã§ãã
å¾åãNeco ã§ã¯ã¯ã©ã¹ã¿ã®ã¢ãã¿ãªã³ã°ã« Prometheus ãå©ç¨ãã¦ãã¾ããããæè¿ããã VictoriaMetrics + VictoriaMetrics operator ã«å¤æ´ãã¾ããã æ¬è¨äºã§ã¯ãPrometheus ã§æãã¦ããåé¡ç¹ã¨ããããã©ã®ããã«è§£æ±ºããããç´¹ä»ãã¾ãã
æãã¦ããåé¡ç¹
æã ãï¼ãªãã¬ã¼ã¿ã¼ãå©ç¨ããªãï¼ Prometheus ã§åé¡ãæãã¦ããã®ã¯ä»¥ä¸ã®ç¹ã«ãªãã¾ãã
- ã¡ããªã¯ã¹ã®é·æä¿å
- Neco ã§ã¯å ã 14æ¥éã¶ããä¿åãã¦ãã¾ãããããããéå»ã®ã¡ããªã¯ã¹ã¯é害ã®ç¶ç¶çãªèª¿æ»ã«ãæç¨ã§ããã14æ¥éã§ã¯ç©è¶³ããªãæãã¦ãã¾ãããä¸æ¹ã Prometheus ã¯ã¹ãã¬ã¼ã¸ã®æ§é ã¨ãã¦é·æä¿åããã¾ãæ³å®ãã¦ãã¾ããã https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
- HA æ§æ
- 以åã®è¨äº ã«ããã¨ãããNeco ã§ã¯æ¯è¼çé »ç¹ã«å ¨ä½åèµ·åãè¡ã£ã¦ããã®ã§ããããã®éã«ã¢ãã¿ãªã³ã°ãæ¢ã¾ã£ã¦ãã¾ãã®ã¯é¿ããªããã°ãªãã¾ããã Prometheus ãåã«è¤æ°ä¸¦ã¹ãåé·åã¯å¯è½ã§ããããã®å ´åã¹ãã¬ã¼ã¸ã¯ãããããå¥åã«æã¤ãã¨ã«ãªãã¾ããèªã¤ã³ã¹ã¿ã³ã¹ã®ãã¼ã¿ãæ¬ ãã¦ãä»ã¤ã³ã¹ã¿ã³ã¹ã®ãã¼ã¿ã¯åç §ã§ããªãã®ã§ãããã§ã¯å ·åãæªãã§ãã
- ãã«ãããã³ã·ã¼
- Neco ç°å¢ã§ã¯ Kubernetes ç°å¢ãéçº/éç¨ãã¦ãããã¼ã ï¼Neco ãã¼ã ï¼ã¨ããã®ä¸ã§åãã¢ããªã±ã¼ã·ã§ã³ãéçº/éç¨ãã¦ãããã¼ã ï¼ããã³ããè¤æ°ããï¼ã¯å¥ã§ããããããããããããã®ã³ã³ãã¼ãã³ããã¢ãã¿ãªã³ã°ãã¦ãã¾ããã¢ãã¿ãªã³ã°ã®ç³»ã¯ããããã§ç«ã¦ãå¿ è¦ãããã¾ãããã§ããã°çååãããã¨ããã§ãã
代æ¿æ¡
ã¡ããªã¯ã¹ã®é·æä¿åã«ã¤ãã¦èãã¦ã¿ãã¨ã VictoriaMetrics ã®ä»ã« Thanos, Cortex, M3DB ã¨ãã£ãé¸æè¢ãæãããã¾ãã VictoriaMetrics ã¯ä»¥ä¸ã®ãããªç¹å¾´ãããã¾ãã
- æ§æãã·ã³ãã«
- ã¿ã¤ã ã·ãªã¼ãºã¹ãã¬ã¼ã¸ã¨ãã¦å¹ççï¼å§ç¸®æ¯ãªã©ï¼
- æ©è½ãã¨ã«ãã¾ãåå²ããã¦ããã Prometheus ãã段éçã«ç§»è¡ãããã¨ãå¯è½
- drop-in replacement ã称ãã¦ãããä»®ã«å ¨ä½ãç½®ãæãã¦ãã使ç¨æãå¤ãããªã
VictoriaMetrics ã¯å ã Prometheus åãã®ãªã¢ã¼ãã¹ãã¬ã¼ã¸ã¨ãã¦éçºããã¾ãããããã®å¾ Prometheus ã¨äºææ§ã®ããã¹ã¯ã¬ã¤ãã³ã°ãã¢ã©ã¼ãå¤å®ã®ããã®ã³ã³ãã¼ãã³ãã追å ãããPrometheus ã® drop-in replacement ã¨ãã¦ååãªæ©è½ãããã¾ã*1ã ã¾ããæè¿ã¯ãªãã¬ã¼ã¿ã¼å®è£ ãéçºãé²ãã§ãã¾ãããã®ããããªãã¬ã¼ã¿ã¼ã使ã£ã¦ã¢ãã¿ãªã³ã°ãå ¨ä½çã« VictoriaMetrics ã«ç§»è¡ãããã¨ã¨ãã¾ããã
VictoriaMetrics ã«ããã¨ã©ããªãã
ã¡ããªã¯ã¹ã®é·æä¿å
VictoriaMetrics ã¯é·æä¿åãæ³å®ãã¦å®è£ ããã¦ãã¾ãã Neco ç°å¢ã§ã¯ã²ã¨ã¾ãä¿åæéã1å¹´å¼·ã«è¨å®ãã¦éç¨ãéå§ãã¦ãã¾ããVictoriaMetrics 㯠Prometheus ã¨æ¯è¼ãã¦ãã¼ã¿ã®å§ç¸®è½åãé«ããããé·ãã®ä¿åæéã§ãã¹ãã¬ã¼ã¸ã®æ¶è²»ãå°ãªãã®ãããããã¨ããã§ãã
HA æ§æ
VictoriaMetrics ã«ã¯ cluster version ã¨ãããã®ãããã¾ããããã¯ããã¼ã¿ã®ã¬ããªã±ã¼ã·ã§ã³ã¨èªã¿æ¸ããªã¯ã¨ã¹ãã®åæ£ã«ãã£ã¦ãã¹ãã¬ã¼ã¸ã«é¢ãã¦ã¹ã±ã¼ã«ã¢ã¦ãå¯è½ãªHAæ§æãå®ç¾ãããã®ã§ããã¾ããã¹ã¯ã¬ã¤ãã³ã°ãã¢ã©ã¼ãå¤å®ã«ã¤ãã¦ãåç´ã«è¤æ°ã¬ããªã«ãç«ã¦ããã¨ã§ HA æ§æãåããã¨ãã§ãã¾ãã
ãã«ãããã³ã·ã¼
ãªãã¬ã¼ã¿ã¼ãå°å ¥ãããããããã³ãã¯ã«ã¹ã¿ã ãªã½ã¼ã¹ãã¡ãã£ã¨è¨è¿°ããã ãã§ã¢ãã¿ãªã³ã°ã¯ã©ã¹ã¿ãç«ã¦ããã¨ãã§ãã¾ããä¾ãã°ãå¿ è¦ãªã³ã³ãã¼ãã³ãã¯ä»¥ä¸ã®ã«ã¹ã¿ã ãªã½ã¼ã¹ã§ãããã¤ã§ãã¾ããï¼Alertmanager åãã®è¨å®ãä¿åãã Secret ã¯çç¥ï¼
apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAgent metadata: name: vmagent namespace: tenant-ns spec: replicaCount: 3 remoteWrite: - url: "http://vminsert-vmcluster-largeset.monitoring.svc:8480/insert/0/prometheus/api/v1/write" --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAlertmanager metadata: name: vmam namespace: tenant-ns spec: replicaCount: 3 configSecret: vmam-config --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAlert metadata: name: vmalert namespace: tenant-ns spec: replicaCount: 3 datasource: url: "http://vmselect-vmcluster-largeset.monitoring.svc:8481/select/0/prometheus" notifiers: - url: "http://vmalertmanager-vmam-0.vmalertmanager-vmam.tenant-ns.svc:9093" - url: "http://vmalertmanager-vmam-1.vmalertmanager-vmam.tenant-ns.svc:9093" - url: "http://vmalertmanager-vmam-2.vmalertmanager-vmam.tenant-ns.svc:9093"
cluster version ã®ã¹ãã¬ã¼ã¸ã«ã¯ãã«ãããã³ã·ã¼æ©è½ããã£ã¦ãããã³ããã¨ã«èªããã³ãã ããèªã¿æ¸ãã§ããã¹ãã¬ã¼ã¸ã®ããã«æ¯èããã¨ãã§ãã¾ããããããNeco ã§ã¯ãã®æ©è½ã使ããã«ã1ã¤ã®ã¹ãã¬ã¼ã¸ã¨ãã¦ä½¿ããã¨ã«ãã¾ããããã®å ´åãããã³ãã¯èªåã§ã¹ã¯ã¬ã¤ãããã¡ããªã¯ã¹ã¨Neco ãã¼ã å´ã§ã¹ã¯ã¬ã¤ããã cAdvisor ã kube-state-metrics ã®ã¡ããªã¯ã¹ãçµã¿åããã¦ç¬èªã®ã¢ã©ã¼ãã«ã¼ã«ãè¨è¿°ãããã¨ãã§ãã¾ãã
ãããªãå¯ç¨æ§
å®éã«ãã¼ã¿ãä¿åãããã¹ãã¬ã¼ã¸ã¯ Ceph RBD ã使ããã¨ã«ãã¾ãããããã«ãããã¹ãã¬ã¼ã¸ããã¤ã¹ã®æ éã«å¯¾ãã¦ãèæ§ãæããã¦ãã¾ããä¸æ¹ãããããã¨ä»åº¦ã¯ Ceph ã®é害ãçºçããã¨ã¢ãã¿ãªã³ã°ãå·»ãè¾¼ã¾ãã¦ä¸ç·ã«æ¢ã¾ã£ã¦ãã¾ãæ¸å¿µãããã¾ããããã§ã¯ããã¾ããã
ããã§ãCeph ã¨æ¬æ¥ã®ã¢ãã¿ãªã³ã°ã¯ã©ã¹ã¿ãã¢ãã¿ãªã³ã°ããããã®æå°éã®ã¢ãã¿ãªã³ã°ã¯ã©ã¹ã¿ããCeph ã使ããã«ç¨æãããã¨ã«ãã¾ãããNeco ã§ã¯ããã®æå°éã®ã¯ã©ã¹ã¿ã smallset ãå ¨ä½ãç£è¦ããæ¹ã®ã¯ã©ã¹ã¿ã largeset ã¨å¼ãã§ãã¾ãã smallset ã¯ããã¾ã§ãè£å©ã¨ãã¦ä½¿ããã®ã§ãã¹ãã¬ã¼ã¸ã« TopoLVM ã使ããä¿åæéãçãã§ãã2ã¤ã®ã¯ã©ã¹ã¿ãå«ãã¢ãã¿ãªã³ã°ã®æ§æå³ã以ä¸ã«ç¤ºãã¾ãã
Grafana
ã¡ããªã¯ã¹ã®å¯è¦åã«ã¯ Grafana ã使ãã®ãä¸è¬çã§ããVictoriaMetrics ã¯ä¸è¨ã®ããã«ãã«ãããã³ã·ã¼ãå®ç¾ãã¾ããããGrafana ãåæ§ã«ãã«ãããã³ã·ã¼ãå®ç¾ããå¿ è¦ãããã¾ãã Neco ã§ã¯ä»¥åãã grafana-operator ã使ç¨ãã¦ãããããã·ã¥ãã¼ãå®ç¾©ãã«ã¹ã¿ã ãªã½ã¼ã¹ã¨ãã¦è¨è¿°ããã¨ãNeco ç°å¢å ã§ç¨¼åãã¦ãã Grafana ã«ããã·ã¥ãã¼ãã追å ã§ããããã«ãã¦ããã¾ããããã«ãããããã³ãå´ã§ããã·ã¥ãã¼ããèªç±ã«è¿½å ãããã¨ãã§ãã¾ãã
ã³ã³ããªãã¥ã¼ã·ã§ã³
VictoriaMetrics operator ã¯éçºãå§ã¾ã£ãã°ããã§ããããã使ã£ã¦ã¿ããã¨ããã¨ããã¯ãããããã¨åé¡ãæ©è½ä¸è¶³ãè¦ã¤ãããã®ã§ããNeco ãã¼ã ã§ã¯ç¶ç¶çã« upstream ã«ã³ã³ããªãã¥ã¼ã·ã§ã³ããã¦ãã¾ããç¾å¨ã feature request ãæããã¨çµæ§æ©ãå®è£ ãã¦ããããã®ãããããã¨ããã§ãã
æå¾ã«
æ¬è¨äºã§ã¯ VictoriaMetrics + operator ã使ç¨ããã¢ãã¿ãªã³ã°ã®æ§æä¾ãç´¹ä»ãã¾ãããé«å¯ç¨åãå®ç¾ã§ãããã¨ã§ãã©ãã¯ä¸¸ãã¨é害ã®è¨ç·´æã§ãå æ°ã«ã¢ã©ã¼ããçºåºã§ãã¦ãã¾ããçããã®ããè¯ãã¢ãã¿ãªã³ã°ã©ã¤ãã®åèã«ãªãã°å¹¸ãã§ãã
*1:Alertmanager ã«ç¸å½ãããã®ã¯ VictoriaMetrics ã®æ¹ã«ã¯å®è£ ããªãã®ã§ãPrometheus ã®å®è£ ããã®ã¾ã¾ä½¿ãã¾ãã