MRANGE for similar keys

Hi everyone!

I’m new to timeseries. And my usecase is:
I have multiple restaurants and a metric, that i need to count for each restaurant and a global one.
I wanted to reduce duplication and not create dedicated series for global stats. So I ran the following:
TS.ADD crt:1 * 600 LABELS restaurant_id 1
TS.ADD crt:1 * 500 LABELS restaurant_id 1
TS.ADD crt:2 * 400 LABELS restaurant_id 2
TS.ADD crt:2 * 300 LABELS restaurant_id 2

It works fine, for TS.RANGE for specific key or MRANGE for FILTER restaurant_id=1.
But how can I get avg for timestamp for all crt:* series? Do I need one more label eg: metric crt or am I missing something?
Thanks in advance!

Yes you should add a new Label that will allow you to retrieve all the crt series.

1 Like