Distinct counts
Count unique users and IDs in your metrics
Most metrics tell you how many times something happened. A distinct count tells you how many different things it happened to - how many unique users logged in today, not how many logins there were.
How it works
Send a numeric id as the metric's value. Switch on a distinct count for a level, and every minute, hour or day at that level keeps a distinct count alongside its sum, mean, minimum and maximum.
# the value is a numeric id; with a distinct count on, each day's distinct count is how many different ids were seen
curl -X POST https://easy-obs.com/api/metric/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"metric": "active_users", "value": 48213}'
Pick a size by how many different values you expect
A bigger filter can count more, and multiplies the metric's price more. Roughly how many different values each can hold:
- 1 KB - about 660 different values - 2 times the price
- 8 KB - about 5,300 different values - 3 times the price
- 64 KB - about 42,000 different values - 4 times the price
- 512 KB - about 340,000 different values - 5 times the price
How accurate is it?
Approximate - and it can only ever count low, never high. Within a filter's size the count is typically within about 1% of the true figure; give it far more different values than it was sized for and it under-counts more. A calculator in the app recommends the smallest size for the number you expect.
Things to know
- Values are numbers, so send a numeric id (or a number derived from one)
- Each level keeps its own distinct count: a day's unique users and a month's are counted separately - the month is not the sum of its days
- A distinct count only applies to data from the moment you switch it on
- Price: a metric kept to day level is 45 credits a month on default retention ($0.045); a distinct count multiplies the price of the level it is on - see the pricing page
Questions, answered
What is a distinct count, and how accurate is it?
For any level you can switch on a distinct count, which counts how many different values a metric saw in each minute, hour or day. This is very useful for e.g. counting unique user ids for DAU / MAU stats. Note that there is a price premium for using distinct counts, due to the large amount of data they require.
How do I send data?
The REST API has endpoints for each of /logs/, /metrics/ and /traces/, and it also has a multi-endpoint for sending all three types in one request - ideal for a post-request hook.
How much does it cost?
There are no per-host, per-seat or per-gigabyte charges, and you start with 10,000 free credits. Add more credits any time as necessary, and use the pricing calculator to plan ahead. Each level of a metric costs 15 to 75 credits a month at its default retention (a day level is the cheapest, a minute level the dearest), and 500 logs, or 250 traces, kept for a day cost 1 credit.