Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Added notes on metrics cardinality #828

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/docs/services/metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,24 @@ LOGGING['handlers']['console:metrics'] = {
'formatter': 'metrics',
}
```

## Notes on Metrics

When emitting metrics you need to be careful about cardinality. Particularly for
metrics that are supposed to be sent to Datadog, at our scale there can be large
server bills heading our way if a high cardinality tag is emitted. Examples for
high cardinality tags are:

* `event_id`, `request_id` etc.: these are unique values, absolutely pointless and
if one were to emit them at our scale: very, very expensive.
* `project_id`, `org_id`: for common operations that happen across the entire user
base: still a very bad idea. Maybe they are acceptable for very rare circumstances
or things that only happen for a small segment of the user base (eg: when you are
tracking a beta feature with a small user base, but even in that case probably
a horrible idea).

Probably acceptable cardinality:

* `platform` as in SDK platform: there is a finite number of them.
* `status` as in HTTP status code: not great, but we expect a finite number of them.
* `task_name`, `endpoint` etc.
Loading