OpenStack Gnocchi - 相当于 ceilometer /v2/meter/[meter]/statistics
我正在寻找 Gnocchi 的 ceilometer Web api 的 /meter/[meterName]/statistics
端点的完全等效项,但我正在努力寻找等效项,看起来没有办法检索相同的信息。
ceilometer 端点提到,当调用简单的统计请求时(使用 GET /v2/meters/
GET /v2/meters/instance/statistics
q: [{"field": "user_id",
"op": "eq",
"value": "user-2"},
{"field": "source",
"op": "eq",
"value": "source-1"}]
groupby: ["project_id", "resource_id"]
它将产生如下输出:(
[{"count": 4, "duration_start": "2013-09-18T19:08:33", "min": 1.0,
"max": 1.0, "duration_end": "2013-09-18T19:27:30", "period": 0,
"sum": 4.0, "period_end": "2013-09-18T19:27:30", "duration": 1137.0,
"period_start": "2013-09-18T19:08:33", "avg": 1.0,
"groupby": {"project_id": "c2334f175d8b4cb8b1db49d83cecde78",
"resource_id": "551f495f-7f49-4624-a34c-c422f2c5f90b"},
"unit": "image"},
{"count": 4, "duration_start": "2013-09-18T19:08:36", "min": 1.0,
"max": 1.0, "duration_end": "2013-09-18T19:27:30", "period": 0,
"sum": 4.0, "period_end": "2013-09-18T19:27:30", "duration": 1134.0,
"period_start": "2013-09-18T19:08:36", "avg": 1.0,
"groupby": {"project_id": "c2334f175d8b4cb8b1db49d83cecde78",
"resource_id": "7c1157ed-cf30-48af-a868-6c7c3ad7b531"},
"unit": "image"},
{"count": 4, "duration_start": "2013-09-18T19:08:34", "min": 1.0,
"max": 1.0, "duration_end": "2013-09-18T19:27:30", "period": 0,
"sum": 4.0, "period_end": "2013-09-18T19:27:30", "duration": 1136.0,
"period_start": "2013-09-18T19:08:34", "avg": 1.0,
"groupby": {"project_id": "c2334f175d8b4cb8b1db49d83cecde78",
"resource_id": "eaed9cf4-fc99-4115-93ae-4a5c37a1a7d7"},
"unit": "image"}]
有关该内容的文档可以在 此处)。
相反,在 Gnocchi 中(可以在此处找到有关 Web api 的文档),我没有找到任何生成相同信息的方法,我能匹配的最接近的是使用动态聚合 api,尽管似乎没有任何方法可以过滤元数据: https://gnocchi.osci.io/rest.html#groupby
POST /v1/aggregates?start=2014-10-06T14:34&groupby=host&groupby=flavor_id HTTP/1.1
Content-Type: application/json
Content-Length: 149
{
"operations": "(* (aggregate mean (metric cpu.util mean)) 4)",
"resource_type": "instance",
"search": "server_group='my_autoscaling_group'"
}
将产生如下内容:
HTTP/1.1 200 OK
Content-Length: 550
Content-Type: application/json
[
{
"group": {
"flavor_id": "2",
"host": "compute1"
},
"measures": {
"measures": {
"aggregated": [
[
"2014-10-06T14:00:00+00:00",
3600.0,
43.333333333333336
],
[
"2014-10-06T14:34:00+00:00",
60.0,
58.0
],
[
"2014-10-06T14:34:12+00:00",
1.0,
80.0
],
[
"2014-10-06T14:34:20+00:00",
1.0,
36.0
]
]
}
}
},
{
"group": {
"flavor_id": "2",
"host": "compute2"
},
"measures": {
"measures": {
"aggregated": [
[
"2014-10-06T14:00:00+00:00",
3600.0,
58.4
],
[
"2014-10-06T14:30:00+00:00",
1800.0,
58.4
],
[
"2014-10-06T14:34:12+00:00",
1.0,
18.0
],
[
"2014-10-06T14:34:20+00:00",
1.0,
56.8
]
]
}
}
}
]
但是,除了不允许过滤元数据之外,端点仍然会产生测量值(聚合度量)而不是聚合数据。
尽管 OpenStack 文档中提到 Gnocchi 作为 Ceilometer 的更新替代品,但似乎没有任何方法可以生成相同的数据。
有人设法找到一种方法来替换云高计端点吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过官方 Gnocchi 存储库通过 github 得到了答案。
看起来您无法直接获得相同的输出,尽管有两种可能的策略可以接近它:
有关更多信息,请直接在此处找到
I've got an answer through github through the official Gnocchi repository.
It looks like you cannot directly get the same output, although there are two possible strategies to get close to it:
More about that can be directly found here