File: memory.libsonnet

package info (click to toggle)
prometheus-elasticsearch-exporter 1.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,664 kB
  • sloc: sh: 63; makefile: 37
file content (47 lines) | stat: -rw-r--r-- 1,223 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
local g = import '../g.libsonnet';
local prometheusQuery = g.query.prometheus;

local variables = import '../variables.libsonnet';

{
  memoryUsage:
    prometheusQuery.new(
      '$' + variables.datasource.name,
      |||
        elasticsearch_jvm_memory_used_bytes{cluster=~"$cluster"}
      |||
    )
    + prometheusQuery.withLegendFormat('{{name}} {{area}}'),

  memoryUsageAverage15:
    prometheusQuery.new(
      '$' + variables.datasource.name,
      |||
        avg_over_time(
          elasticsearch_jvm_memory_used_bytes{cluster=~"$cluster"}[15m]
        ) /
        elasticsearch_jvm_memory_max_bytes{cluster=~"$cluster"}
      |||
    )
    + prometheusQuery.withLegendFormat('{{name}} {{area}}'),

  memoryMax:
    prometheusQuery.new(
      '$' + variables.datasource.name,
      |||
        elasticsearch_jvm_memory_max_bytes{cluster=~"$cluster"}
      |||
    )
    + prometheusQuery.withLegendFormat('{{name}} {{area}}'),

  gcSeconds:
    prometheusQuery.new(
      '$' + variables.datasource.name,
      |||
        rate(
          elasticsearch_jvm_gc_collection_seconds_sum{cluster=~"$cluster"}[$__rate_interval]
        )
      |||
    )
    + prometheusQuery.withLegendFormat('{{name}} {{gc}}'),
}