Prometheus: Fix handling errors in streaming client (#61643)

* Return errors from data parsing

* Better error handling

* Fix the tests

* When there is no frame add empty frame to get metadata attached to it

* Fix tests

* Update testdata
This commit is contained in:
ismail simsek
2023-01-18 22:30:15 +01:00
committed by GitHub
parent 2c46f46d37
commit 29c8ce12a0
5 changed files with 56 additions and 14 deletions
@@ -26,6 +26,16 @@
// +-----------------------------------+-----------------+--------------------------------------------+----------------+-------------------+-------------------+----------------+----------------+--------------------+----------------+------------------+-----------------+-------------------+----------------------------------+
//
//
//
// Frame[1] {
// "executedQueryString": "Expr: histogram_quantile(0.99, sum(rate(traces_spanmetrics_duration_seconds_bucket[15s])) by (le))\nStep: 15s"
// }
// Name:
// Dimensions: 0 Fields by 0 Rows
// +
// +
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
@@ -1040,6 +1050,17 @@
]
]
}
},
{
"schema": {
"meta": {
"executedQueryString": "Expr: histogram_quantile(0.99, sum(rate(traces_spanmetrics_duration_seconds_bucket[15s])) by (le))\nStep: 15s"
},
"fields": []
},
"data": {
"values": []
}
}
]
}
@@ -26,6 +26,16 @@
// +-----------------------------------+-----------------+--------------------------------------------+----------------+-------------------+-------------------+----------------+----------------+--------------------+----------------+------------------+-----------------+-------------------+----------------------------------+
//
//
//
// Frame[1] {
// "executedQueryString": "Expr: histogram_quantile(0.99, sum(rate(traces_spanmetrics_duration_seconds_bucket[15s])) by (le))\nStep: 15s"
// }
// Name:
// Dimensions: 0 Fields by 0 Rows
// +
// +
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
@@ -1040,6 +1050,17 @@
]
]
}
},
{
"schema": {
"meta": {
"executedQueryString": "Expr: histogram_quantile(0.99, sum(rate(traces_spanmetrics_duration_seconds_bucket[15s])) by (le))\nStep: 15s"
},
"fields": []
},
"data": {
"values": []
}
}
]
}