From 73303ae8c759569c61c072792ce6d83078456aaf Mon Sep 17 00:00:00 2001 From: Tetiana Kravchenko Date: Wed, 11 Oct 2023 11:17:19 +0200 Subject: [PATCH] [Prometheus] Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms (#36647) * Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms: Use the preceding bucket's value for +Inf 'le', for the first bucket only: if it has a negative 'le', use the value as-is; add test for the negative buckets; extend explanation on the counts calculation Signed-off-by: Tetiana Kravchenko * fix prometheus remote_write tests; regenerate istio expected documents; revert unrelated changes Signed-off-by: Tetiana Kravchenko * add link to the design/motivation of the histogram transformation logic Signed-off-by: Tetiana Kravchenko --------- Signed-off-by: Tetiana Kravchenko --- CHANGELOG.next.asciidoc | 1 + .../istiod.v1.7.1.plain-expected.json | 436 +++++++++--------- .../testdata/proxy.v1.7.1.plain-expected.json | 218 ++++----- .../prometheus/collector/_meta/data.json | 2 +- .../_meta/testdata/docs.plain-expected.json | 44 +- .../metrics-with-naninf.plain-expected.json | 86 ++-- ...ometheus-2.6.0-partial.plain-expected.json | 374 +++++++-------- .../module/prometheus/collector/histogram.go | 31 +- .../prometheus/collector/histogram_test.go | 58 +++ .../remote_write/remote_write_test.go | 12 +- 10 files changed, 667 insertions(+), 595 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 133d02c70f1..7c161b640bc 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -251,6 +251,7 @@ is collected by it. - Add GCP CloudSQL metadata {pull}33066[33066] - Add GCP Carbon Footprint metricbeat data {pull}34820[34820] - Add event loop utilization metric to Kibana module {pull}35020[35020] +- Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms {pull}36647[36647] *Osquerybeat* diff --git a/x-pack/metricbeat/module/istio/istiod/_meta/testdata/istiod.v1.7.1.plain-expected.json b/x-pack/metricbeat/module/istio/istiod/_meta/testdata/istiod.v1.7.1.plain-expected.json index 2d96ee6b90e..d7c4a090c06 100644 --- a/x-pack/metricbeat/module/istio/istiod/_meta/testdata/istiod.v1.7.1.plain-expected.json +++ b/x-pack/metricbeat/module/istio/istiod/_meta/testdata/istiod.v1.7.1.plain-expected.json @@ -11,13 +11,38 @@ }, "prometheus": { "labels": { - "event": "add", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "Gateway" + "type": "rds" }, - "pilot_k8s_cfg_events": { - "counter": 1, + "pilot_xds_push_time": { + "histogram": { + "counts": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "values": [ + 0.005, + 0.05500000000000001, + 0.55, + 2, + 4, + 7.5, + 15, + 25, + 30 + ] + } + }, + "pilot_xds_pushes": { + "counter": 9, "rate": 0 } }, @@ -39,12 +64,12 @@ "prometheus": { "labels": { "event": "add", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "Nodes" + "type": "EnvoyFilter" }, - "pilot_k8s_reg_events": { - "counter": 1, + "pilot_k8s_cfg_events": { + "counter": 8, "rate": 0 } }, @@ -66,7 +91,7 @@ "prometheus": { "labels": { "event": "update", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", "type": "Nodes" }, @@ -93,12 +118,12 @@ "prometheus": { "labels": { "event": "add", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "DestinationRule" + "type": "Services" }, - "pilot_k8s_cfg_events": { - "counter": 4, + "pilot_k8s_reg_events": { + "counter": 11, "rate": 0 } }, @@ -119,12 +144,13 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "event": "add", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "proxy" + "type": "Endpoints" }, - "pilot_push_triggers": { - "counter": 1, + "pilot_k8s_reg_events": { + "counter": 12, "rate": 0 } }, @@ -145,38 +171,13 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "event": "add", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "lds" - }, - "pilot_xds_push_time": { - "histogram": { - "counts": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "values": [ - 0.005, - 0.05500000000000001, - 0.55, - 2, - 4, - 7.5, - 15, - 25, - 40 - ] - } + "type": "VirtualService" }, - "pilot_xds_pushes": { - "counter": 9, + "pilot_k8s_cfg_events": { + "counter": 1, "rate": 0 } }, @@ -197,13 +198,12 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "svc" + "version": "1.7.1" }, - "pilot_inbound_updates": { - "counter": 22, - "rate": 0 + "pilot_xds": { + "value": 8 } }, "service": { @@ -223,42 +223,12 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "eds" - }, - "pilot_inbound_updates": { - "counter": 54, - "rate": 0 - }, - "pilot_xds_push_time": { - "histogram": { - "counts": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "values": [ - 0.005, - 0.05500000000000001, - 0.55, - 2, - 4, - 7.5, - 15, - 25, - 40 - ] - } + "type": "endpoint" }, - "pilot_xds_pushes": { - "counter": 49, + "pilot_push_triggers": { + "counter": 40, "rate": 0 } }, @@ -279,13 +249,12 @@ }, "prometheus": { "labels": { - "event": "add", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "EnvoyFilter" + "type": "proxy" }, - "pilot_k8s_cfg_events": { - "counter": 8, + "pilot_push_triggers": { + "counter": 1, "rate": 0 } }, @@ -306,12 +275,13 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "event": "add", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "endpoint" + "type": "Nodes" }, - "pilot_push_triggers": { - "counter": 40, + "pilot_k8s_reg_events": { + "counter": 1, "rate": 0 } }, @@ -332,12 +302,14 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "event": "updatesame", + "instance": "127.0.0.1:49430", "job": "istio", - "version": "1.7.1" + "type": "Endpoints" }, - "pilot_xds": { - "value": 8 + "pilot_k8s_reg_events": { + "counter": 185, + "rate": 0 } }, "service": { @@ -357,14 +329,12 @@ }, "prometheus": { "labels": { - "event": "add", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "Services" + "version": "1.7.1-4e26c697ce460dc8d3b25b25818fb0163ca16394-Clean" }, - "pilot_k8s_reg_events": { - "counter": 11, - "rate": 0 + "pilot_info": { + "value": 1 } }, "service": { @@ -385,7 +355,7 @@ "prometheus": { "labels": { "event": "update", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", "type": "Pods" }, @@ -411,13 +381,13 @@ }, "prometheus": { "labels": { - "event": "update", - "instance": "127.0.0.1:51143", + "event": "add", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "Endpoints" + "type": "DestinationRule" }, - "pilot_k8s_reg_events": { - "counter": 30, + "pilot_k8s_cfg_events": { + "counter": 4, "rate": 0 } }, @@ -426,31 +396,6 @@ "type": "istio" } }, - { - "event": { - "dataset": "istio.istiod", - "duration": 115000, - "module": "istio" - }, - "metricset": { - "name": "istiod", - "period": 10000 - }, - "prometheus": { - "labels": { - "instance": "127.0.0.1:51143", - "job": "istio", - "version": "1.7.1-4e26c697ce460dc8d3b25b25818fb0163ca16394-Clean" - }, - "pilot_info": { - "value": 1 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "istio" - } - }, { "event": { "dataset": "istio.istiod", @@ -464,12 +409,12 @@ "prometheus": { "labels": { "event": "add", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "Endpoints" + "type": "Pods" }, "pilot_k8s_reg_events": { - "counter": 12, + "counter": 22, "rate": 0 } }, @@ -490,13 +435,12 @@ }, "prometheus": { "labels": { - "event": "add", - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "VirtualService" + "type": "config" }, - "pilot_k8s_cfg_events": { - "counter": 1, + "pilot_inbound_updates": { + "counter": 90, "rate": 0 } }, @@ -517,7 +461,7 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", "type": "cds" }, @@ -543,7 +487,7 @@ 7.5, 15, 25, - 40 + 30 ] } }, @@ -568,68 +512,17 @@ "period": 10000 }, "prometheus": { - "labels": { - "event": "add", - "instance": "127.0.0.1:51143", - "job": "istio", - "type": "Pods" - }, - "pilot_k8s_reg_events": { - "counter": 22, + "galley_validation_failed": { + "counter": 1, "rate": 0 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "istio" - } - }, - { - "event": { - "dataset": "istio.istiod", - "duration": 115000, - "module": "istio" - }, - "metricset": { - "name": "istiod", - "period": 10000 - }, - "prometheus": { - "labels": { - "event": "updatesame", - "instance": "127.0.0.1:51143", - "job": "istio", - "type": "Endpoints" }, - "pilot_k8s_reg_events": { - "counter": 185, - "rate": 0 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "istio" - } - }, - { - "event": { - "dataset": "istio.istiod", - "duration": 115000, - "module": "istio" - }, - "metricset": { - "name": "istiod", - "period": 10000 - }, - "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "group": "networking.istio.io", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "config" - }, - "pilot_inbound_updates": { - "counter": 90, - "rate": 0 + "reason": "invalid_resource", + "resource": "gateways", + "version": "v1alpha3" } }, "service": { @@ -664,7 +557,7 @@ "rate": 0 }, "labels": { - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio" }, "pilot_conflict_inbound_listener": { @@ -716,7 +609,7 @@ 7.5, 15, 25, - 40 + 30 ] } }, @@ -740,7 +633,7 @@ 7.5, 15, 25, - 40 + 30 ] } }, @@ -771,9 +664,9 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:51143", + "instance": "127.0.0.1:49430", "job": "istio", - "type": "rds" + "type": "lds" }, "pilot_xds_push_time": { "histogram": { @@ -797,7 +690,7 @@ 7.5, 15, 25, - 40 + 30 ] } }, @@ -822,17 +715,124 @@ "period": 10000 }, "prometheus": { - "galley_validation_failed": { - "counter": 1, + "labels": { + "instance": "127.0.0.1:49430", + "job": "istio", + "type": "eds" + }, + "pilot_inbound_updates": { + "counter": 54, + "rate": 0 + }, + "pilot_xds_push_time": { + "histogram": { + "counts": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "values": [ + 0.005, + 0.05500000000000001, + 0.55, + 2, + 4, + 7.5, + 15, + 25, + 30 + ] + } + }, + "pilot_xds_pushes": { + "counter": 49, "rate": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "istio" + } + }, + { + "event": { + "dataset": "istio.istiod", + "duration": 115000, + "module": "istio" + }, + "metricset": { + "name": "istiod", + "period": 10000 + }, + "prometheus": { + "labels": { + "instance": "127.0.0.1:49430", + "job": "istio", + "type": "svc" + }, + "pilot_inbound_updates": { + "counter": 22, + "rate": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "istio" + } + }, + { + "event": { + "dataset": "istio.istiod", + "duration": 115000, + "module": "istio" + }, + "metricset": { + "name": "istiod", + "period": 10000 + }, + "prometheus": { + "labels": { + "event": "update", + "instance": "127.0.0.1:49430", + "job": "istio", + "type": "Endpoints" }, + "pilot_k8s_reg_events": { + "counter": 30, + "rate": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "istio" + } + }, + { + "event": { + "dataset": "istio.istiod", + "duration": 115000, + "module": "istio" + }, + "metricset": { + "name": "istiod", + "period": 10000 + }, + "prometheus": { "labels": { - "group": "networking.istio.io", - "instance": "127.0.0.1:51143", + "event": "add", + "instance": "127.0.0.1:49430", "job": "istio", - "reason": "invalid_resource", - "resource": "gateways", - "version": "v1alpha3" + "type": "Gateway" + }, + "pilot_k8s_cfg_events": { + "counter": 1, + "rate": 0 } }, "service": { diff --git a/x-pack/metricbeat/module/istio/proxy/_meta/testdata/proxy.v1.7.1.plain-expected.json b/x-pack/metricbeat/module/istio/proxy/_meta/testdata/proxy.v1.7.1.plain-expected.json index 742e696fe76..ed91734e024 100644 --- a/x-pack/metricbeat/module/istio/proxy/_meta/testdata/proxy.v1.7.1.plain-expected.json +++ b/x-pack/metricbeat/module/istio/proxy/_meta/testdata/proxy.v1.7.1.plain-expected.json @@ -54,7 +54,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -102,12 +102,12 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "istio_requests_total": { - "counter": 5, + "counter": 6, "rate": 0 }, "istio_response_bytes": { @@ -154,35 +154,35 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "labels": { - "connection_security_policy": "none", - "destination_app": "productpage", + "connection_security_policy": "unknown", + "destination_app": "details", "destination_canonical_revision": "v1", - "destination_canonical_service": "productpage", - "destination_principal": "unknown", - "destination_service": "172.17.0.12:15000", - "destination_service_name": "InboundPassthroughClusterIpv4", + "destination_canonical_service": "details", + "destination_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-details", + "destination_service": "details.default.svc.cluster.local", + "destination_service_name": "details", "destination_service_namespace": "default", "destination_version": "v1", - "destination_workload": "productpage-v1", + "destination_workload": "details-v1", "destination_workload_namespace": "default", - "instance": "127.0.0.1:49701", + "instance": "127.0.0.1:49435", "job": "istio", - "reporter": "destination", + "reporter": "source", "request_protocol": "http", - "response_code": "503", - "response_flags": "UF", - "source_app": "unknown", - "source_canonical_revision": "latest", - "source_canonical_service": "unknown", - "source_principal": "unknown", - "source_version": "unknown", - "source_workload": "unknown", - "source_workload_namespace": "unknown" + "response_code": "200", + "response_flags": "-", + "source_app": "productpage", + "source_canonical_revision": "v1", + "source_canonical_service": "productpage", + "source_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-productpage", + "source_version": "v1", + "source_workload": "productpage-v1", + "source_workload_namespace": "default" } }, "service": { @@ -245,7 +245,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -293,12 +293,12 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "istio_requests_total": { - "counter": 2, + "counter": 5, "rate": 0 }, "istio_response_bytes": { @@ -345,35 +345,35 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "labels": { - "connection_security_policy": "unknown", - "destination_app": "reviews", - "destination_canonical_revision": "v2", - "destination_canonical_service": "reviews", - "destination_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-reviews", - "destination_service": "reviews.default.svc.cluster.local", - "destination_service_name": "reviews", + "connection_security_policy": "none", + "destination_app": "productpage", + "destination_canonical_revision": "v1", + "destination_canonical_service": "productpage", + "destination_principal": "unknown", + "destination_service": "172.17.0.12:15000", + "destination_service_name": "InboundPassthroughClusterIpv4", "destination_service_namespace": "default", - "destination_version": "v2", - "destination_workload": "reviews-v2", + "destination_version": "v1", + "destination_workload": "productpage-v1", "destination_workload_namespace": "default", - "instance": "127.0.0.1:49701", + "instance": "127.0.0.1:49435", "job": "istio", - "reporter": "source", + "reporter": "destination", "request_protocol": "http", - "response_code": "200", - "response_flags": "-", - "source_app": "productpage", - "source_canonical_revision": "v1", - "source_canonical_service": "productpage", - "source_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-productpage", - "source_version": "v1", - "source_workload": "productpage-v1", - "source_workload_namespace": "default" + "response_code": "503", + "response_flags": "UF", + "source_app": "unknown", + "source_canonical_revision": "latest", + "source_canonical_service": "unknown", + "source_principal": "unknown", + "source_version": "unknown", + "source_workload": "unknown", + "source_workload_namespace": "unknown" } }, "service": { @@ -436,7 +436,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -484,12 +484,12 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "istio_requests_total": { - "counter": 6, + "counter": 2, "rate": 0 }, "istio_response_bytes": { @@ -536,23 +536,23 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "labels": { "connection_security_policy": "unknown", - "destination_app": "details", - "destination_canonical_revision": "v1", - "destination_canonical_service": "details", - "destination_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-details", - "destination_service": "details.default.svc.cluster.local", - "destination_service_name": "details", + "destination_app": "reviews", + "destination_canonical_revision": "v2", + "destination_canonical_service": "reviews", + "destination_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-reviews", + "destination_service": "reviews.default.svc.cluster.local", + "destination_service_name": "reviews", "destination_service_namespace": "default", - "destination_version": "v1", - "destination_workload": "details-v1", + "destination_version": "v2", + "destination_workload": "reviews-v2", "destination_workload_namespace": "default", - "instance": "127.0.0.1:49701", + "instance": "127.0.0.1:49435", "job": "istio", "reporter": "source", "request_protocol": "http", @@ -627,7 +627,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -675,7 +675,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -727,7 +727,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -743,7 +743,7 @@ "destination_version": "v1", "destination_workload": "productpage-v1", "destination_workload_namespace": "default", - "instance": "127.0.0.1:49701", + "instance": "127.0.0.1:49435", "job": "istio", "reporter": "destination", "request_protocol": "http", @@ -763,6 +763,32 @@ "type": "istio" } }, + { + "event": { + "dataset": "istio.proxy", + "duration": 115000, + "module": "istio" + }, + "metricset": { + "name": "proxy", + "period": 10000 + }, + "prometheus": { + "istio_build": { + "value": 1 + }, + "labels": { + "component": "proxy", + "instance": "127.0.0.1:49435", + "job": "istio", + "tag": "1.7.1" + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "istio" + } + }, { "event": { "dataset": "istio.proxy", @@ -818,7 +844,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -866,7 +892,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -918,7 +944,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -934,7 +960,7 @@ "destination_version": "v1", "destination_workload": "productpage-v1", "destination_workload_namespace": "default", - "instance": "127.0.0.1:49701", + "instance": "127.0.0.1:49435", "job": "istio", "reporter": "destination", "request_protocol": "http", @@ -954,32 +980,6 @@ "type": "istio" } }, - { - "event": { - "dataset": "istio.proxy", - "duration": 115000, - "module": "istio" - }, - "metricset": { - "name": "proxy", - "period": 10000 - }, - "prometheus": { - "istio_build": { - "value": 1 - }, - "labels": { - "component": "proxy", - "instance": "127.0.0.1:49701", - "job": "istio", - "tag": "1.7.1" - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "istio" - } - }, { "event": { "dataset": "istio.proxy", @@ -1035,7 +1035,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -1083,12 +1083,12 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "istio_requests_total": { - "counter": 1, + "counter": 3, "rate": 0 }, "istio_response_bytes": { @@ -1135,23 +1135,23 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "labels": { "connection_security_policy": "unknown", "destination_app": "reviews", - "destination_canonical_revision": "v3", + "destination_canonical_revision": "v1", "destination_canonical_service": "reviews", "destination_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-reviews", "destination_service": "reviews.default.svc.cluster.local", "destination_service_name": "reviews", "destination_service_namespace": "default", - "destination_version": "v3", - "destination_workload": "reviews-v3", + "destination_version": "v1", + "destination_workload": "reviews-v1", "destination_workload_namespace": "default", - "instance": "127.0.0.1:49701", + "instance": "127.0.0.1:49435", "job": "istio", "reporter": "source", "request_protocol": "http", @@ -1226,7 +1226,7 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, @@ -1274,12 +1274,12 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "istio_requests_total": { - "counter": 3, + "counter": 1, "rate": 0 }, "istio_response_bytes": { @@ -1326,23 +1326,23 @@ 450000, 1200000, 2700000, - 5400000 + 3600000 ] } }, "labels": { "connection_security_policy": "unknown", "destination_app": "reviews", - "destination_canonical_revision": "v1", + "destination_canonical_revision": "v3", "destination_canonical_service": "reviews", "destination_principal": "spiffe://cluster.local/ns/default/sa/bookinfo-reviews", "destination_service": "reviews.default.svc.cluster.local", "destination_service_name": "reviews", "destination_service_namespace": "default", - "destination_version": "v1", - "destination_workload": "reviews-v1", + "destination_version": "v3", + "destination_workload": "reviews-v3", "destination_workload_namespace": "default", - "instance": "127.0.0.1:49701", + "instance": "127.0.0.1:49435", "job": "istio", "reporter": "source", "request_protocol": "http", diff --git a/x-pack/metricbeat/module/prometheus/collector/_meta/data.json b/x-pack/metricbeat/module/prometheus/collector/_meta/data.json index f6c2e256b75..a9f1a53d10c 100644 --- a/x-pack/metricbeat/module/prometheus/collector/_meta/data.json +++ b/x-pack/metricbeat/module/prometheus/collector/_meta/data.json @@ -11,7 +11,7 @@ }, "prometheus": { "labels": { - "device": "br-210476dc4ef8", + "device": "br-4e623477470e", "job": "prometheus" }, "node_network_carrier": { diff --git a/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/docs.plain-expected.json b/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/docs.plain-expected.json index 6810afce3f6..2b1a2f55d70 100644 --- a/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/docs.plain-expected.json +++ b/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/docs.plain-expected.json @@ -11,8 +11,8 @@ }, "prometheus": { "labels": { - "device": "br-210476dc4ef8", - "instance": "127.0.0.1:41313", + "device": "br-4e623477470e", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { @@ -36,8 +36,8 @@ }, "prometheus": { "labels": { - "device": "br-0cb306323b90", - "instance": "127.0.0.1:41313", + "device": "br-210476dc4ef8", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { @@ -61,12 +61,11 @@ }, "prometheus": { "labels": { - "device": "br-10229e3512d9", - "instance": "127.0.0.1:41313", + "instance": "127.0.0.1:64033", "job": "prometheus" }, - "node_network_carrier": { - "value": 0 + "up": { + "value": 1 } }, "service": { @@ -87,7 +86,7 @@ "prometheus": { "labels": { "device": "br-33d819d5f834", - "instance": "127.0.0.1:41313", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { @@ -111,11 +110,12 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:41313", + "device": "br-10229e3512d9", + "instance": "127.0.0.1:64033", "job": "prometheus" }, - "up": { - "value": 1 + "node_network_carrier": { + "value": 0 } }, "service": { @@ -135,8 +135,8 @@ }, "prometheus": { "labels": { - "device": "br-38425a39f36b", - "instance": "127.0.0.1:41313", + "device": "br-38feb0aad6ab", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { @@ -160,8 +160,8 @@ }, "prometheus": { "labels": { - "device": "br-3a285aa5e58c", - "instance": "127.0.0.1:41313", + "device": "br-0cb306323b90", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { @@ -185,8 +185,8 @@ }, "prometheus": { "labels": { - "device": "br-38feb0aad6ab", - "instance": "127.0.0.1:41313", + "device": "br-3a285aa5e58c", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { @@ -210,8 +210,8 @@ }, "prometheus": { "labels": { - "device": "br-4e623477470e", - "instance": "127.0.0.1:41313", + "device": "br-425cb4c454a6", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { @@ -235,8 +235,8 @@ }, "prometheus": { "labels": { - "device": "br-425cb4c454a6", - "instance": "127.0.0.1:41313", + "device": "br-38425a39f36b", + "instance": "127.0.0.1:64033", "job": "prometheus" }, "node_network_carrier": { diff --git a/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/metrics-with-naninf.plain-expected.json b/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/metrics-with-naninf.plain-expected.json index d781fda7bc8..b2c36b40bfc 100644 --- a/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/metrics-with-naninf.plain-expected.json +++ b/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/metrics-with-naninf.plain-expected.json @@ -10,13 +10,38 @@ "period": 10000 }, "prometheus": { - "go_gc_duration_seconds": { - "value": 0.000098154 + "go_gc_duration_seconds_count": { + "counter": 13118, + "rate": 0 + }, + "go_gc_duration_seconds_sum": { + "counter": 3.451780079, + "rate": 0 + }, + "http_request_duration_seconds": { + "histogram": { + "counts": [ + 0, + 0, + 0, + 0, + 0 + ], + "values": [ + 0.5, + 1.5, + 2.5, + 4, + 5 + ] + } }, "labels": { - "instance": "127.0.0.1:42061", - "job": "prometheus", - "quantile": "0.75" + "instance": "127.0.0.1:64035", + "job": "prometheus" + }, + "up": { + "value": 1 } }, "service": { @@ -39,7 +64,7 @@ "value": 0.011689149 }, "labels": { - "instance": "127.0.0.1:42061", + "instance": "127.0.0.1:64035", "job": "prometheus", "quantile": "1" } @@ -60,37 +85,12 @@ "period": 10000 }, "prometheus": { - "go_gc_duration_seconds_count": { - "counter": 13118, - "rate": 0 - }, - "go_gc_duration_seconds_sum": { - "counter": 3.451780079, - "rate": 0 - }, - "http_request_duration_seconds": { - "histogram": { - "counts": [ - 0, - 0, - 0, - 0, - 0 - ], - "values": [ - 0.5, - 1.5, - 2.5, - 4, - 7 - ] - } - }, - "up": { - "value": 1 + "kafka_consumer_records_lag_records": { + "value": 5 }, "labels": { - "instance": "127.0.0.1:42061", + "client_id": "consumer4", + "instance": "127.0.0.1:64035", "job": "prometheus" } }, @@ -110,13 +110,13 @@ "period": 10000 }, "prometheus": { - "kafka_consumer_records_lag_records": { - "value": 5 + "go_gc_duration_seconds": { + "value": 0.000098154 }, "labels": { - "client_id": "consumer4", - "instance": "127.0.0.1:42061", - "job": "prometheus" + "instance": "127.0.0.1:64035", + "job": "prometheus", + "quantile": "0.75" } }, "service": { @@ -140,7 +140,7 @@ "rate": 0 }, "labels": { - "instance": "127.0.0.1:42061", + "instance": "127.0.0.1:64035", "job": "prometheus", "method": "GET" } @@ -162,7 +162,7 @@ }, "prometheus": { "labels": { - "instance": "127.0.0.1:42061", + "instance": "127.0.0.1:64035", "job": "prometheus", "listener_name": "http" }, @@ -175,4 +175,4 @@ "type": "prometheus" } } -] +] \ No newline at end of file diff --git a/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/prometheus-2.6.0-partial.plain-expected.json b/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/prometheus-2.6.0-partial.plain-expected.json index a1e48feb18d..c6c4f34bba5 100644 --- a/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/prometheus-2.6.0-partial.plain-expected.json +++ b/x-pack/metricbeat/module/prometheus/collector/_meta/testdata/prometheus-2.6.0-partial.plain-expected.json @@ -11,12 +11,12 @@ }, "prometheus": { "labels": { - "dialer_name": "prometheus", - "instance": "127.0.0.1:34181", + "dialer_name": "alertmanager", + "instance": "127.0.0.1:64037", "job": "prometheus" }, "net_conntrack_dialer_conn_attempted_total": { - "counter": 1, + "counter": 0, "rate": 0 }, "net_conntrack_dialer_conn_closed_total": { @@ -24,36 +24,6 @@ "rate": 0 }, "net_conntrack_dialer_conn_established_total": { - "counter": 1, - "rate": 0 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "prometheus" - } - }, - { - "event": { - "dataset": "prometheus.collector", - "duration": 115000, - "module": "prometheus" - }, - "metricset": { - "name": "collector", - "period": 10000 - }, - "prometheus": { - "labels": { - "instance": "127.0.0.1:34181", - "job": "prometheus", - "listener_name": "http" - }, - "net_conntrack_listener_conn_accepted_total": { - "counter": 3, - "rate": 0 - }, - "net_conntrack_listener_conn_closed_total": { "counter": 0, "rate": 0 } @@ -74,127 +44,13 @@ "period": 10000 }, "prometheus": { - "go_gc_duration_seconds_count": { - "counter": 4, - "rate": 0 - }, - "go_gc_duration_seconds_sum": { - "counter": 0.004534198, - "rate": 0 - }, - "go_goroutines": { - "value": 35 - }, - "go_memstats_alloc_bytes": { - "value": 10558112 - }, - "go_memstats_alloc_bytes_total": { - "counter": 14087760, - "rate": 0 - }, - "go_memstats_buck_hash_sys_bytes": { - "value": 1447018 - }, - "go_memstats_frees_total": { - "counter": 15673, - "rate": 0 - }, - "go_memstats_gc_cpu_fraction": { - "value": 0.0008429952574435172 - }, - "go_memstats_gc_sys_bytes": { - "value": 2379776 - }, - "go_memstats_heap_alloc_bytes": { - "value": 10558112 - }, - "go_memstats_heap_idle_bytes": { - "value": 54042624 - }, - "go_memstats_heap_inuse_bytes": { - "value": 12214272 - }, - "go_memstats_heap_objects": { - "value": 61771 - }, - "go_memstats_heap_released_bytes": { - "value": 0 - }, - "go_memstats_heap_sys_bytes": { - "value": 66256896 - }, - "go_memstats_last_gc_time_seconds": { - "value": 1553430316.1488917 - }, - "go_memstats_lookups_total": { - "counter": 0, - "rate": 0 - }, - "go_memstats_mallocs_total": { - "counter": 77444, - "rate": 0 - }, - "go_memstats_mcache_inuse_bytes": { - "value": 6912 - }, - "go_memstats_mcache_sys_bytes": { - "value": 16384 - }, - "go_memstats_mspan_inuse_bytes": { - "value": 127984 - }, - "go_memstats_mspan_sys_bytes": { - "value": 131072 - }, - "go_memstats_next_gc_bytes": { - "value": 18390112 - }, - "go_memstats_other_sys_bytes": { - "value": 1201294 - }, - "go_memstats_stack_inuse_bytes": { - "value": 851968 - }, - "go_memstats_stack_sys_bytes": { - "value": 851968 - }, - "go_memstats_sys_bytes": { - "value": 72284408 - }, - "go_threads": { - "value": 14 + "go_gc_duration_seconds": { + "value": 0.000042803 }, "labels": { - "instance": "127.0.0.1:34181", - "job": "prometheus" - }, - "process_cpu_seconds_total": { - "counter": 0.14, - "rate": 0 - }, - "process_max_fds": { - "value": 1048576 - }, - "process_open_fds": { - "value": 13 - }, - "process_resident_memory_bytes": { - "value": 35934208 - }, - "process_start_time_seconds": { - "value": 1553430305.4 - }, - "process_virtual_memory_bytes": { - "value": 150646784 - }, - "process_virtual_memory_max_bytes": { - "value": -1 - }, - "prometheus_api_remote_read_queries": { - "value": 0 - }, - "up": { - "value": 1 + "instance": "127.0.0.1:64037", + "job": "prometheus", + "quantile": "0.25" } }, "service": { @@ -214,19 +70,15 @@ }, "prometheus": { "labels": { - "dialer_name": "default", - "instance": "127.0.0.1:34181", - "job": "prometheus" - }, - "net_conntrack_dialer_conn_attempted_total": { - "counter": 0, - "rate": 0 + "instance": "127.0.0.1:64037", + "job": "prometheus", + "listener_name": "http" }, - "net_conntrack_dialer_conn_closed_total": { - "counter": 0, + "net_conntrack_listener_conn_accepted_total": { + "counter": 3, "rate": 0 }, - "net_conntrack_dialer_conn_established_total": { + "net_conntrack_listener_conn_closed_total": { "counter": 0, "rate": 0 } @@ -247,13 +99,13 @@ "period": 10000 }, "prometheus": { - "go_info": { - "value": 1 + "go_gc_duration_seconds": { + "value": 0.004392391 }, "labels": { - "instance": "127.0.0.1:34181", + "instance": "127.0.0.1:64037", "job": "prometheus", - "version": "go1.11.3" + "quantile": "0.75" } }, "service": { @@ -273,12 +125,12 @@ }, "prometheus": { "labels": { - "dialer_name": "alertmanager", - "instance": "127.0.0.1:34181", + "dialer_name": "prometheus", + "instance": "127.0.0.1:64037", "job": "prometheus" }, "net_conntrack_dialer_conn_attempted_total": { - "counter": 0, + "counter": 1, "rate": 0 }, "net_conntrack_dialer_conn_closed_total": { @@ -286,7 +138,7 @@ "rate": 0 }, "net_conntrack_dialer_conn_established_total": { - "counter": 0, + "counter": 1, "rate": 0 } }, @@ -307,12 +159,12 @@ }, "prometheus": { "go_gc_duration_seconds": { - "value": 0.004392391 + "value": 0.000060618 }, "labels": { - "instance": "127.0.0.1:34181", + "instance": "127.0.0.1:64037", "job": "prometheus", - "quantile": "1" + "quantile": "0.5" } }, "service": { @@ -335,7 +187,7 @@ "value": 0.000038386 }, "labels": { - "instance": "127.0.0.1:34181", + "instance": "127.0.0.1:64037", "job": "prometheus", "quantile": "0" } @@ -357,12 +209,12 @@ }, "prometheus": { "go_gc_duration_seconds": { - "value": 0.000060618 + "value": 0.004392391 }, "labels": { - "instance": "127.0.0.1:34181", + "instance": "127.0.0.1:64037", "job": "prometheus", - "quantile": "0.5" + "quantile": "1" } }, "service": { @@ -381,13 +233,161 @@ "period": 10000 }, "prometheus": { - "go_gc_duration_seconds": { - "value": 0.000042803 + "labels": { + "dialer_name": "default", + "instance": "127.0.0.1:64037", + "job": "prometheus" + }, + "net_conntrack_dialer_conn_attempted_total": { + "counter": 0, + "rate": 0 + }, + "net_conntrack_dialer_conn_closed_total": { + "counter": 0, + "rate": 0 + }, + "net_conntrack_dialer_conn_established_total": { + "counter": 0, + "rate": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "prometheus" + } + }, + { + "event": { + "dataset": "prometheus.collector", + "duration": 115000, + "module": "prometheus" + }, + "metricset": { + "name": "collector", + "period": 10000 + }, + "prometheus": { + "go_gc_duration_seconds_count": { + "counter": 4, + "rate": 0 + }, + "go_gc_duration_seconds_sum": { + "counter": 0.004534198, + "rate": 0 + }, + "go_goroutines": { + "value": 35 + }, + "go_memstats_alloc_bytes": { + "value": 10558112 + }, + "go_memstats_alloc_bytes_total": { + "counter": 14087760, + "rate": 0 + }, + "go_memstats_buck_hash_sys_bytes": { + "value": 1447018 + }, + "go_memstats_frees_total": { + "counter": 15673, + "rate": 0 + }, + "go_memstats_gc_cpu_fraction": { + "value": 0.0008429952574435172 + }, + "go_memstats_gc_sys_bytes": { + "value": 2379776 + }, + "go_memstats_heap_alloc_bytes": { + "value": 10558112 + }, + "go_memstats_heap_idle_bytes": { + "value": 54042624 + }, + "go_memstats_heap_inuse_bytes": { + "value": 12214272 + }, + "go_memstats_heap_objects": { + "value": 61771 + }, + "go_memstats_heap_released_bytes": { + "value": 0 + }, + "go_memstats_heap_sys_bytes": { + "value": 66256896 + }, + "go_memstats_last_gc_time_seconds": { + "value": 1553430316.1488917 + }, + "go_memstats_lookups_total": { + "counter": 0, + "rate": 0 + }, + "go_memstats_mallocs_total": { + "counter": 77444, + "rate": 0 + }, + "go_memstats_mcache_inuse_bytes": { + "value": 6912 + }, + "go_memstats_mcache_sys_bytes": { + "value": 16384 + }, + "go_memstats_mspan_inuse_bytes": { + "value": 127984 + }, + "go_memstats_mspan_sys_bytes": { + "value": 131072 + }, + "go_memstats_next_gc_bytes": { + "value": 18390112 + }, + "go_memstats_other_sys_bytes": { + "value": 1201294 + }, + "go_memstats_stack_inuse_bytes": { + "value": 851968 + }, + "go_memstats_stack_sys_bytes": { + "value": 851968 + }, + "go_memstats_sys_bytes": { + "value": 72284408 + }, + "go_threads": { + "value": 14 }, "labels": { - "instance": "127.0.0.1:34181", - "job": "prometheus", - "quantile": "0.25" + "instance": "127.0.0.1:64037", + "job": "prometheus" + }, + "process_cpu_seconds_total": { + "counter": 0.14, + "rate": 0 + }, + "process_max_fds": { + "value": 1048576 + }, + "process_open_fds": { + "value": 13 + }, + "process_resident_memory_bytes": { + "value": 35934208 + }, + "process_start_time_seconds": { + "value": 1553430305.4 + }, + "process_virtual_memory_bytes": { + "value": 150646784 + }, + "process_virtual_memory_max_bytes": { + "value": -1 + }, + "prometheus_api_remote_read_queries": { + "value": 0 + }, + "up": { + "value": 1 } }, "service": { @@ -406,13 +406,13 @@ "period": 10000 }, "prometheus": { - "go_gc_duration_seconds": { - "value": 0.004392391 + "go_info": { + "value": 1 }, "labels": { - "instance": "127.0.0.1:34181", + "instance": "127.0.0.1:64037", "job": "prometheus", - "quantile": "0.75" + "version": "go1.11.3" } }, "service": { @@ -420,4 +420,4 @@ "type": "prometheus" } } -] +] \ No newline at end of file diff --git a/x-pack/metricbeat/module/prometheus/collector/histogram.go b/x-pack/metricbeat/module/prometheus/collector/histogram.go index 375e62def93..a49ccfcd829 100644 --- a/x-pack/metricbeat/module/prometheus/collector/histogram.go +++ b/x-pack/metricbeat/module/prometheus/collector/histogram.go @@ -23,16 +23,24 @@ import ( // } // // This code takes a Prometheus histogram and tries to accommodate it into an ES histogram by: +// // - calculating centroids for each bucket (values) +// - for +Inf "le" bucket, use the preceding bucket's value +// - for the first bucket only: if it has a negative "le", use the value as-is; otherwise use half its value +// - for all other buckets, use the midpoint from that bucket's value to the preceding bucket's // - undoing counters accumulation for each bucket (counts) +// - `counts` is respresenting an array of rates, where rate of the first bucket is always 0, meaning that it +// was not increased as it is the first +// More details on the histogram transformation logic - https://github.com/elastic/apm-agent-python/pull/1165#discussion_r651397014 // // https://www.elastic.co/guide/en/elasticsearch/reference/master/histogram.html + func PromHistogramToES(cc CounterCache, name string, labels mapstr.M, histogram *p.Histogram) mapstr.M { var values []float64 var counts []uint64 // calculate centroids and rated counts - var lastUpper, prevUpper float64 + var lastUpper float64 var sumCount, prevCount uint64 for _, bucket := range histogram.GetBucket() { // Ignore non-numbers @@ -40,18 +48,23 @@ func PromHistogramToES(cc CounterCache, name string, labels mapstr.M, histogram continue } - if bucket.GetUpperBound() == math.Inf(0) { - // Report +Inf bucket as a point, interpolating its value - values = append(values, lastUpper+(lastUpper-prevUpper)) + bucketUpperBound := bucket.GetUpperBound() + if bucketUpperBound == math.Inf(0) { + // Report +Inf bucket as a point, use the preceding bucket's value + values = append(values, lastUpper) } else { - // calculate bucket centroid - values = append(values, lastUpper+(bucket.GetUpperBound()-lastUpper)/2.0) - prevUpper = lastUpper - lastUpper = bucket.GetUpperBound() + // for the first bucket only: if it has a negative "le", use the value as-is + if bucketUpperBound < 0 && len(values) == 0 { + values = append(values, bucketUpperBound) + } else { + // calculate bucket centroid + values = append(values, lastUpper+(bucketUpperBound-lastUpper)/2.0) + } + lastUpper = bucketUpperBound } // Take count for this period (rate) - countRate, found := cc.RateUint64(name+labels.String()+fmt.Sprintf("%f", bucket.GetUpperBound()), bucket.GetCumulativeCount()) + countRate, found := cc.RateUint64(name+labels.String()+fmt.Sprintf("%f", bucketUpperBound), bucket.GetCumulativeCount()) switch { case !found: diff --git a/x-pack/metricbeat/module/prometheus/collector/histogram_test.go b/x-pack/metricbeat/module/prometheus/collector/histogram_test.go index 5bfd9413230..0aaf57a4a0c 100644 --- a/x-pack/metricbeat/module/prometheus/collector/histogram_test.go +++ b/x-pack/metricbeat/module/prometheus/collector/histogram_test.go @@ -389,6 +389,64 @@ func TestPromHistogramToES(t *testing.T) { }, }, }, + "histogram with negative buckets": { + samples: []sample{ + { + histogram: p.Histogram{ + SampleCount: proto.Uint64(30), + SampleSum: proto.Float64(5), + Bucket: []*p.Bucket{ + { + UpperBound: proto.Float64(-100), + CumulativeCount: proto.Uint64(2), + }, + { + UpperBound: proto.Float64(-99), + CumulativeCount: proto.Uint64(10), + }, + { + UpperBound: proto.Float64(0), + CumulativeCount: proto.Uint64(30), + }, + }, + }, + expected: mapstr.M{ + // rate of the first bucket is always 0, meaning that it was not increased as it is the first + // count rate: [0, 8, 20] + "counts": []uint64{0, 0, 0}, + "values": []float64{-100, -99.5, -49.5}, + }, + }, + { + histogram: p.Histogram{ + SampleCount: proto.Uint64(100), + SampleSum: proto.Float64(20), + Bucket: []*p.Bucket{ + { + UpperBound: proto.Float64(-100), + CumulativeCount: proto.Uint64(5), + }, + { + UpperBound: proto.Float64(-99), + CumulativeCount: proto.Uint64(16), + }, + { + UpperBound: proto.Float64(0), + CumulativeCount: proto.Uint64(100), + }, + }, + }, + expected: mapstr.M{ + // counts calculation: + // UpperBound -100: 5-2 + // UpperBound -99: 16 - 5 (undo accumulation) - 8 (calculate rate) + // UpperBound 0: 100 - 16 (undo accumulation) - 20 (calculate rate) + "counts": []uint64{3, 3, 64}, + "values": []float64{-100, -99.5, -49.5}, + }, + }, + }, + }, } metricName := "somemetric" diff --git a/x-pack/metricbeat/module/prometheus/remote_write/remote_write_test.go b/x-pack/metricbeat/module/prometheus/remote_write/remote_write_test.go index 3cc9b237c8d..76b591c44eb 100644 --- a/x-pack/metricbeat/module/prometheus/remote_write/remote_write_test.go +++ b/x-pack/metricbeat/module/prometheus/remote_write/remote_write_test.go @@ -811,7 +811,7 @@ func TestGenerateEventsHistogramsDifferentLabels(t *testing.T) { expected := mapstr.M{ "http_request_duration_seconds": mapstr.M{ "histogram": mapstr.M{ - "values": []float64{float64(0.125), float64(0.375), float64(0.75)}, + "values": []float64{float64(0.125), float64(0.375), float64(0.5)}, "counts": []uint64{uint64(0), uint64(0), uint64(0)}, }, }, @@ -825,7 +825,7 @@ func TestGenerateEventsHistogramsDifferentLabels(t *testing.T) { }, "http_request_bytes": mapstr.M{ "histogram": mapstr.M{ - "values": []float64{float64(0.125), float64(0.375), float64(0.75)}, + "values": []float64{float64(0.125), float64(0.375), float64(0.5)}, "counts": []uint64{uint64(0), uint64(0), uint64(0)}, }, }, @@ -842,7 +842,7 @@ func TestGenerateEventsHistogramsDifferentLabels(t *testing.T) { expected2 := mapstr.M{ "http_request_bytes": mapstr.M{ "histogram": mapstr.M{ - "values": []float64{float64(0.125), float64(0.375), float64(0.75)}, + "values": []float64{float64(0.125), float64(0.375), float64(0.5)}, "counts": []uint64{uint64(0), uint64(0), uint64(0)}, }, }, @@ -1002,7 +1002,7 @@ func TestGenerateEventsHistogramsDifferentLabels(t *testing.T) { expected = mapstr.M{ "http_request_duration_seconds": mapstr.M{ "histogram": mapstr.M{ - "values": []float64{float64(0.125), float64(0.375), float64(0.75)}, + "values": []float64{float64(0.125), float64(0.375), float64(0.5)}, "counts": []uint64{uint64(100), uint64(0), uint64(0)}, }, }, @@ -1016,7 +1016,7 @@ func TestGenerateEventsHistogramsDifferentLabels(t *testing.T) { }, "http_request_bytes": mapstr.M{ "histogram": mapstr.M{ - "values": []float64{float64(0.125), float64(0.375), float64(0.75)}, + "values": []float64{float64(0.125), float64(0.375), float64(0.5)}, "counts": []uint64{uint64(200), uint64(0), uint64(0)}, }, }, @@ -1033,7 +1033,7 @@ func TestGenerateEventsHistogramsDifferentLabels(t *testing.T) { expected2 = mapstr.M{ "http_request_bytes": mapstr.M{ "histogram": mapstr.M{ - "values": []float64{float64(0.125), float64(0.375), float64(0.75)}, + "values": []float64{float64(0.125), float64(0.375), float64(0.5)}, "counts": []uint64{uint64(300), uint64(0), uint64(0)}, }, },