您可以在 Grafana 后面运行的数据库之一是Axibase 时间序列数据库 https://axibase.com/docs/atsd/(ATSD)。它提供内置聚合函数,可以执行 SLA 类型的计算,例如,计算值超过阈值时的时间段百分比。
- THRESHOLD COUNT - 期间内的违规次数
- THRESHOLD_DURATION - 违规的累积持续时间
- THRESHOLD_PERCENT - 持续时间除以周期
在您的示例中,该值为 THRESHOLD_PERCENT。
以下是 Amazon Web Services 实例的 SLA 报告示例:https://apps.axibase.com/chartlab/0aa34311/6/ https://apps.axibase.com/chartlab/0aa34311/6/。 THRESHOLD_PERCENT 在顶部图表上直观显示。
API 请求如下所示:
{
"queries": [{
"startDate": "2016-02-22T00:00:00Z",
"endDate": "2016-02-23T00:00:00Z",
"timeFormat": "iso",
"entity": "nurswgvml007",
"metric": "app.response_time",
"aggregate": {
"types": [
"THRESHOLD_COUNT",
"THRESHOLD_DURATION",
"THRESHOLD_PERCENT"
],
"period": {
"count": 1,
"unit": "HOUR"
},
"threshold": {
"max": 200
}
}
}]
}
ATSD 驱动程序:https://github.com/grafana/grafana-plugins/tree/master/datasources/atsd https://github.com/grafana/grafana-plugins/tree/master/datasources/atsd
披露:我在 Axibase 工作。