File: document.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 (50 lines) | stat: -rw-r--r-- 1,237 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
48
49
50
local g = import '../g.libsonnet';
local prometheusQuery = g.query.prometheus;

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

{
  indexedDocuments:
    prometheusQuery.new(
      '$' + variables.datasource.name,
      |||
        elasticsearch_indices_docs{cluster=~"$cluster"}
      |||
    ),

  indexSize:
    prometheusQuery.new(
      '$' + variables.datasource.name,
      |||
        elasticsearch_indices_store_size_bytes{cluster=~"$cluster"}
      |||
    ),

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

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

  queueCount:
    prometheusQuery.new(
      '$' + variables.datasource.name,
      |||
        sum(elasticsearch_thread_pool_queue_count{cluster=~"$cluster",type!="management"}) by (type)
      |||
    )
    + prometheusQuery.withLegendFormat('{{type}}'),

}