Host-agnostic compute queries
Change-Id: I8f4e27577ab528f595cb0a1abb9274bf38fae95d
Related-bug: PROD-30600 (PROD:30600)
(cherry picked from commit 8a3301e9e3359040915882a87be9046bb1410e0e)
diff --git a/prometheus/elasticsearch_exporter/queries/compute.yml b/prometheus/elasticsearch_exporter/queries/compute.yml
index a17cb7f..d4bd84f 100644
--- a/prometheus/elasticsearch_exporter/queries/compute.yml
+++ b/prometheus/elasticsearch_exporter/queries/compute.yml
@@ -7,30 +7,16 @@
# - compute_instance_event_doc_count{event="example"}
# - compute_instance_event_sum_other_doc_count
# - compute_instance_event_doc_count_error_upper_bound
- # - compute_instance_event_host_doc_count{host="example01",event="example"}
- # - compute_instance_event_host_sum_other_doc_count{event="example"}
- # - compute_instance_event_host_doc_count_error_upper_bound{event="example"}
#
indices: '<notification-{now/d}>'
interval: 600
json: |
{
"size": 0,
- "query": {
- "match_all": {}
- },
"aggs": {
"event": {
"terms": {
"field": "event_type.keyword"
- },
- "aggs": {
- "host": {
- "terms": {
- "field": "Hostname.keyword",
- "min_doc_count": 0
- }
- }
}
}
}
@@ -38,9 +24,9 @@
compute_instance_create_start:
# Produces metrics:
- # - compute_instance_create_start_host_doc_count{host="example01"}
- # - compute_instance_create_start_host_event_sum_other_doc_count
- # - compute_instance_create_start_host_doc_count_error_upper_bound
+ # - compute_instance_create_start_event_doc_count
+ # - compute_instance_create_start_event_sum_other_doc_count
+ # - compute_instance_create_start_event_doc_count_error_upper_bound
# - compute_instance_create_start_hits
# - compute_instance_create_start_took_milliseconds
#
@@ -49,16 +35,12 @@
json: |
{
"size": 0,
- "query": {
- "term": {
- "event_type": "compute.instance.create.start"
- }
- },
"aggs": {
- "host": {
- "terms": {
- "field": "Hostname.keyword",
- "min_doc_count": 0
+ "event": {
+ "filter": {
+ "term": {
+ "event_type.keyword": "compute.instance.create.start"
+ }
}
}
}
@@ -66,9 +48,9 @@
compute_instance_create_end:
# Produces metrics:
- # - compute_instance_create_end_host_doc_count{host="example01"}
- # - compute_instance_create_end_host_event_sum_other_doc_count
- # - compute_instance_create_end_host_doc_count_error_upper_bound
+ # - compute_instance_create_end_event_doc_count
+ # - compute_instance_create_end_event_sum_other_doc_count
+ # - compute_instance_create_end_event_doc_count_error_upper_bound
# - compute_instance_create_end_hits
# - compute_instance_create_end_took_milliseconds
#
@@ -77,16 +59,12 @@
json: |
{
"size": 0,
- "query": {
- "term": {
- "event_type": "compute.instance.create.end"
- }
- },
"aggs": {
- "host": {
- "terms": {
- "field": "Hostname.keyword",
- "min_doc_count": 0
+ "event": {
+ "filter": {
+ "term": {
+ "event_type.keyword": "compute.instance.create.end"
+ }
}
}
}
@@ -94,9 +72,9 @@
compute_instance_create_error:
# Produces metrics:
- # - compute_instance_create_error_host_doc_count{host="example01"}
- # - compute_instance_create_error_host_event_sum_other_doc_count
- # - compute_instance_create_error_host_doc_count_error_upper_bound
+ # - compute_instance_create_error_event_doc_count
+ # - compute_instance_create_error_event_sum_other_doc_count
+ # - compute_instance_create_error_event_doc_count_error_upper_bound
# - compute_instance_create_error_hits
# - compute_instance_create_error_took_milliseconds
#
@@ -105,18 +83,13 @@
json: |
{
"size": 0,
- "query": {
- "term": {
- "event_type": "compute.instance.create.error"
- }
- },
"aggs": {
- "host": {
- "terms": {
- "field": "Hostname.keyword",
- "min_doc_count": 0
+ "event": {
+ "filter": {
+ "term": {
+ "event_type.keyword": "compute.instance.create.error"
+ }
}
}
}
}
-