Auf dem Weg zum Plotten

Guten Tag, lieber Leser! Dieser Artikel entstand aus dem Versuch, die BetriebsĂĽberwachung anhand von Analysen zu untersuchen. Es ist nĂĽtzlich fĂĽr Sie, wenn:

  • etwas aus der folgenden Liste ist bekannt: Grafana, InfluxDB, Prometheus, Zabbix oder ein anderes Ăśberwachungssystem mit ähnlichen Ideen;
  • Sie sind kein Experte / Profi / Selbstbewusster in verschiedenen Arten der Anzeige und Statistik von Zeitreihen (andernfalls wird es fĂĽr Sie sehr langweilig).
  • Es besteht der Wunsch, einige Aspekte „unter die Lupe zu nehmen“.

Wenn Sie entscheiden, dass die oben genannten Bedingungen erfĂĽllt sind, sind Sie bei cat willkommen.




"Sag mir bitte, wohin soll ich von hier aus gehen?"
"Wohin willst du gehen?" - antwortete die Katze.
"Es ist mir egal ..." sagte Alice.
"Dann ist es egal, wohin", sagte die Katze.
"... nur um irgendwohin zu gelangen", erklärte Alice.
"Du wirst sicher irgendwohin gehen", sagte die Katze. "Du musst nur lange genug gehen."
Alice im Wunderland von Lewis Carroll

Die Reise beginnt ...


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



, 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 , «».


Offensichtlich arbeiten max und min so lala unabhängig voneinander. Aber was ist, wenn Sie diese beiden kombinieren und ihnen den Durchschnitt hinzufügen? Es stellt sich heraus, dass diese Idee nichts Neues ist, sondern im Allgemeinen uralt wie Pyramiden. Von den „klassischen“ Beispielen in Überwachungssystemen erinnere ich mich an Trends in Zabbix (ich habe absichtlich nach einem Link zu einer älteren Version gesucht) und Graphite Whisper Rollup sowie an das frühere RRDtool , das auch in Cacti verwendet wurde , wo aus irgendeinem Grund min standardmäßig fehlte. Vielleicht ist dies trotz des folgenden Textes einer der besten Ansätze. Es ist sehr informativ, nicht zu laut, intuitiv, billig in der Implementierung, relativ universell und in fast allen modernen Systemen verfügbar.



Beispiele für ähnliches Rendering:
  • in 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