Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

ensuring order for storage aggregation rules #365

Closed
david-jana opened this issue Jun 8, 2018 · 3 comments
Closed

ensuring order for storage aggregation rules #365

david-jana opened this issue Jun 8, 2018 · 3 comments

Comments

@david-jana
Copy link

david-jana commented Jun 8, 2018

It looks like a hash map is used to configure the storage aggregation rules and sorted before creating the storage-aggregation.conf. This means the alphabetical order of the aggregation rule names needs to match the order in which the rules should appear in the .conf file in order for the 'first matching rule is used' principle to work correctly.

By contrast, the storage schema rules are configured using a list which means that the order in which the storage schema rules are written in the puppet .pp file will be preserved in the storage-schemas.conf file that is created.

Using a list to configure the rules seems more intuitive and less likely to result in unintentional reordering of the rules. Is it possible to change the way the storage-aggregation rules are configured to use a list instead of a hash map?

@costimuraru
Copy link

costimuraru commented Aug 10, 2018

👍
this bit us hard. We had the following puppet config:

  'max':
    pattern: '\.max$'
    factor: '0'
    method: 'max'
  'sum':
    pattern: '\.count$'
    factor: '0'
    method: 'sum'
  'default':
    pattern: '.*'
    factor: '0'
    method: 'average'

Because of the key sorting this got translated into the following actual file on the gcache server:

  'default':
    pattern: '.*'
    factor: '0'
    method: 'average'
  'max':
    pattern: '\.max$'
    factor: '0'
    method: 'max'
  'sum':
    pattern: '\.count$'
    factor: '0'
    method: 'sum'

Because the default is first, and matches everything (notice the wildcard regex), all metrics will use it. This means all the metrics used average as aggregation type (even the counts/max/min etc.).

@dwerder
Copy link
Member

dwerder commented Aug 13, 2018

Thnaks for sharing that information. You are free to send a PR.

@dwerder
Copy link
Member

dwerder commented Jun 24, 2020

Changed just a few years later ;-)

@dwerder dwerder closed this as completed Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants