在绘图的路上

下午好,亲爱的读者!本文源于尝试从分析中查看运营监控。如果发生以下情况,它将对您有用:

  • 熟悉以下列表中的某些内容:Grafana,InfluxDB,Prometheus,Zabbix或其他具有类似想法的监视系统;
  • 您不是各种类型的时间序列显示和统计的专家/专家/自信中间人士(否则,这对您而言将很无聊);
  • 希望“在显微镜下”观察某些方面。

如果您确定满足以上条件,欢迎光临。




“请告诉我,我应该从这里去哪里?”
“你想去哪里?” -回答猫。
“我不在乎……”爱丽丝说。
“那就没关系了,”猫说。
“ ...只是去某个地方,”爱丽丝解释说。
“您一定要去某个地方,”猫说。“你只需要花足够长的时间。”
Lewis Carroll的《爱丽丝梦游仙境》

旅程开始...


. , , , , . , «?» . ? , ( , )! , .



, RFC1065:



3.2.3.3. Counter

This application-wide type represents a non-negative integer which

Rose & McCloghrie [Page 8]

RFC 1065 SMI August 1988


monotonically increases until it reaches a maximum value, when it
wraps around and starts increasing again from zero. This memo
specifies a maximum value of 2^32-1 (4294967295 decimal) for
counters.

3.2.3.4. Gauge

This application-wide type represents a non-negative integer, which
may increase or decrease, but which latches at a maximum value. This
memo specifies a maximum value of 2^32-1 (4294967295 decimal) for
gauges.


, , 1988- , : . - , , , Prometheus.


. — : , , . — - . - …


UI Grafana, , , - , $__interval, , , . — , 4k. , , — . , , .


, ( ) « » . :


, “Step count” 200 300 (, , . : 10 , :

“”$group_time
InfluxQLWHERE time>now()-...GROUP BY time(...)
1h20s2
1d (24h)5m30
1w1h360
1month3h1080


, ! ( ) , , .



. ( Influx’, ):


InfluxDB, , : An instantaneous rate of change is equivalent to a derivative ( ), . , , , , (average rate of change). . , , mean ( ), , . , «» , - . , , , , , .



«» : , last, ( InfluxQL, promql ). last . , . , , 00 . non_negative_derivative(first(...)) . , , — , — : ( ) .



, ? .


mean, InfluxDB : max, min, last, , , — stddev. prometheus min_over_time, max_over_time, stddev_over_time, Influx ( , ). Last, , , , , mean: - , mean , «».


显然,max和min将独立地工作。但是,如果您将这两项相加并将平均值相加会怎样?事实证明,这个想法并不是什么新鲜事物,它通常是古老的,就像金字塔一样。在监控系统的“经典”示例中,我记得Zabbix(我有意寻找到旧版本的链接)和Graphite Whisper Rollup以及早期RRDtool(也在Cacti中使用的趋势)的趋势,由于某些原因,默认情况下min缺失。也许,尽管有以下所有文字,但这是最好的方法之一。它非常有用,不太嘈杂,直观,易于实现,相对通用,几乎可以在所有现代系统中使用。



相似渲染的示例:
  • 在zabbix中
  • Grafana


, min mean ( max avg) , , Grafana Legend -> Values , , , .


«»


, , stddev — standard deviation, - . , , . , , «» . , (, , , , ).


, : error bar. — “ ”, 1-, 2- 3- (25% , 75% ). , ? :) , , Grafana. , pandas seaborn ( plotly).


, , « » , , . “the Datasaurus Dozen animation” Google.




, , , . , , , .


, « » . ? seaborn! , : violinplot. , « » « -» , , - , : violinplot Grafana.



: , , ? , ? ? , ? - .


, , . : Google SRE book. « » (, , ): latency, traffic, errors, saturation. , - ( ), . : saturation % 100, : 100, «» , 0 — , , , . , , — , .



, : . , , , /. (, , ): pull push. , . , , , push — Riemann-tools, pull — Prometheus.


Telegraf, (input-plugins) , (output-plugins) . , discovery-plugins— input-plugins, . , , LLD (low-level discovery) Zabbix, . «»: ( ). (, prometheus-operator), , . , , … Kubernetes, — Influxdata. - ( API/RPC) snap, , , ( , ).


, pull- -, . , . , , , . . , : (, Riemann ). . , , , , (, - ). Graphite / statsd, , , UI. Prometheus recording rules Thanos Compact, TICK- , , : Continues Queries InfluxDB TICKscript Kapacitor. , , — , Histogram Summary Prometheus, Accumulator interface Telegraf.


B , , , , :


, UI, . : , , , UI-preprocessing. , . , «» UI-preprocessing UI, , . , , / — .


« » , 3- , , . , , .



, , : Prometheus, Telegraf . , , heatmap ( ), Grafana. , « », .


Grafana


, Grafana heatmap time series buckets, , , CPU :



, :

  1. :
    ;
    latency, traffic, errors saturation.
  2. , .
  3. ( ), , , .
  4. . - Grafana ( UI ), , , , - Python JS.


Grafana ) UI; ) ; ) .


— , : , , .



, , , . . latency .


All Articles