opentelemetry-erlang icon indicating copy to clipboard operation
opentelemetry-erlang copied to clipboard

Views/Aggregations: Maybe use tuple of attribute values for aggregation record key

Open tsloughter opened this issue 2 years ago • 0 comments

Each _aggregation record (see otel_metrics.hrl) contains a key, which is the name and the attributes of the metric:

key :: {term(),  opentelemetry:attributes_map()}

When attribute filtering is used (see #422) we know the static set of attribute keys and can instead store a tuple or list of just the values and not a map of the key/values.

However, if the View has no set of attributes to filter on then we must keep the attributes as key/vlaue pairs. This is why I put "maybe" in the title. Since we have to use a map or list of tuples in that case then it may not be worth the additional steps to use just the values in other cases.

Alternatives to save space and processing power when storing and comparing the keys should also be considered.

tsloughter avatar Aug 11 '22 12:08 tsloughter