再來一篇Eoghan Glynn關(guān)于Gnocchi的slides。
What's the problem we're trying to solve here?
現(xiàn)有的Ceilometer samples model是free-form metadata的依许,這就導(dǎo)致了雖然很靈活逸嘀,但是太heavy了。
-
導(dǎo)致了一系列影響Ceilometer調(diào)優(yōu)的問題:
- 大量的storage footprint溃肪。
- 數(shù)據(jù)攝入是次優(yōu)的。
- query API是non-scaling的。
API的表達是弱類型的削葱。
Key approaches taken by Gnocchi
- 記錄
強類型的resource
attributes。 - 依靠
events
來重構(gòu)resource state timeline淳梦。 -
Eager pre-aggregate
metric data析砸。 - 支持受限的
cross-metric
aggregation。
Compare and contrast ...
classic Ceilometer | Gnocchi |
---|---|
按需的aggregation | Eager pre-aggregation |
resources和samples在storage中是纏繞在一起的 | resources和time-series data擁有獨立的storage和data models |
Gnocchi basics
- Resource : cloud resource (instance, volume, etc)爆袍。
- Metric : 你想搜集的任何data首繁,靠UUID來辨別,或者name和resourceId的組合螃宙。
- Measure:(timestamp, value) 時序的數(shù)據(jù)點蛮瞄。
- Archive policy: admin定義的數(shù)據(jù)存儲policy。
- 1 second resolution over a day, 1 hour resolution over a year, etc
- 由間隔(in seconds)和保留時間(retention time-span)組成谆扎。
- Aggregation:用來匯聚數(shù)據(jù)的功能(sum, avg, etc)挂捅。
- Retention: 不會永久儲存源數(shù)據(jù),而是儲存根據(jù)archive policy匯聚后的數(shù)據(jù)堂湖。
Gnocchi aggregation mechanism
Goncchi aggregation mechanism.png
Gnocchi Indexer concept
- Gnocchi的主要概念是獲取不同metrics的數(shù)據(jù)點闲先。
- 盡管脫離了resource聯(lián)系状土,metrics沒有任何實際用途。
- Resources是強類型的attributes伺糠。
- Metric用name來做聯(lián)系蒙谓。(e.g. "cpu_util")
- 和resources做松散聯(lián)系的metrics可以用來做cross-aggregate。
- Gnocchi indexer負責(zé)來indexing entities, resources和將它們關(guān)聯(lián)起來训桶。
- Resources和它們的attributes是well-defined, typed和indexed累驮。如果resource type對于Gnocchi是未知的,可以使用generic type舵揭。
Covering existing ceilometer use-cases
- Alarming to drive Heat autoscaling:依賴跨所有instances的aggregating samples with matching meta-data谤专。
- 使用跨metric的aggregation,基于強類型的resource attributes午绳,而不是free-form的metadata置侍。
- 根據(jù)per-sample的resource metadata,重構(gòu)resource state timeline拦焚。
- 使用針對相對罕見的events的queries來獲取state的變化蜡坊。
We're not re-inventing TSDB here
- Gnocchi的可插入式drive model可以利用已有的專業(yè)以metrics為導(dǎo)向的DB (InfluxDB and OpenTSDB)。
- Gnocchi自己基于Pandas和Swift赎败,提供了規(guī)范的存儲驅(qū)動秕衙。
- 在專業(yè)TSDB use-case中,Gnoccchi管理resource-metrics關(guān)系和抽象的archive policy概念螟够。
Ref
Eoghan Glynn http://www.slideshare.net/EoghanGlynn/rdo-hangout-on-gnocchi