Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events count over unique value #304

Open
vkaverin opened this issue Mar 5, 2023 · 1 comment
Open

Events count over unique value #304

vkaverin opened this issue Mar 5, 2023 · 1 comment
Labels
A-api Area: statshouse-api A-sh Area: statshouse (agent / aggregator) C-feature-request Category: request for new functionality

Comments

@vkaverin
Copy link

vkaverin commented Mar 5, 2023

Currently, there's no way to get "How many events were received with the same unique ID?". It would be nice to have all the same functions for that as now offered for value events.

In pseudocode it look like this:

select
  avg(count(unique_id)) as avg,
  min(count(unique_id)) as min,
  max(count(unique_id)) as max,
  p25(count(unique_id)) as p25,
  ...
from 
  my_metrics
group by
  unique_id

Use cases are like:

  • Collecting user views I want to see percentiles to tell how many items single user sees in averages/over percentiles.
  • Collecting API errors metrics I want to see how many errors single user receives.
@flyingmutant flyingmutant added A-api Area: statshouse-api A-sh Area: statshouse (agent / aggregator) C-feature-request Category: request for new functionality labels Mar 6, 2023
@flyingmutant
Copy link
Contributor

As we only store an aggregate for cardinality estimation (think HyperLogLog) of unique values, but not the values themselves -- it is impossible to get back the values or any information tied to them.

If you want to distinguish individual values, you have to use a normal tag (or string-top _s tag if you are only interested in top values) for that. As always, beware of sampling if you data has very high cardinality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: statshouse-api A-sh Area: statshouse (agent / aggregator) C-feature-request Category: request for new functionality
Projects
None yet
Development

No branches or pull requests

2 participants