Grafana: Graph - Noise Range: Unterschied zwischen den Versionen

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche
 
Zeile 2: Zeile 2:
 
[[Datei:01-noise range.png|1200px]] <br>
 
[[Datei:01-noise range.png|1200px]] <br>
  
== Example Flux Query ==
+
=== Example Flux Query ===
The image above is from the following Flux query:
+
The image above is based on the following Flux query:
 
<pre>
 
<pre>
 
//define variables
 
//define variables
Zeile 33: Zeile 33:
 
   |> keep(columns: ["_time", "instance", "mean", "min", "max"])
 
   |> keep(columns: ["_time", "instance", "mean", "min", "max"])
 
</pre>
 
</pre>
 +
 +
 +
=== Grafana settings ===
 +
For the visualization like the image above, you have to settings in the "Graph styles" like in the image above + the "Overrides" from the following image: <br>
 +
[[Datei:01-noise range-overrides.png]]
 +
 +
 +
  
  

Aktuelle Version vom 16. September 2021, 13:32 Uhr

If you want a Grafana Graph that shows the average CPU usage as a line but also the min and max value as a area in the background for example like the image below, then following this site.
01-noise range.png

Example Flux Query

The image above is based on the following Flux query:

//define variables
bucket = "telegraf"

data = from(bucket: bucket)
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => 
    r._measurement == "hyperv_logical_processor" and
    r._field == "Percent_Total_Run_Time"
  )
  |> group(columns: ["instance"])


mean = data
  |> aggregateWindow(every: 10m, fn: mean, createEmpty: false)
  |> set(key: "_field", value: "mean") 

min = data
  |> aggregateWindow(every: 10m, fn: min, createEmpty: false)
  |> set(key: "_field", value: "min") 

max = data
  |> aggregateWindow(every: 10m, fn: max, createEmpty: false)
  |> set(key: "_field", value: "max") 

union(tables: [mean, min, max]) 
  |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> keep(columns: ["_time", "instance", "mean", "min", "max"])


Grafana settings

For the visualization like the image above, you have to settings in the "Graph styles" like in the image above + the "Overrides" from the following image:
01-noise range-overrides.png