prometheus / prometheus/docs

Update best practices for recording rules

Open
#1,860 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
717
Forks
1.2k
Avg merge
3d 15h
Merged PRs (30d)
19

Description

Proposal

Use case. Why is this important?
I found the best practices on recording rules very useful, but one part missing in the naming section is what to do if you have a filter/query in your expression. I'm trying to make a ratio and it uses the same metric, but the numerator has a filter to it (e.g. 4xx / total requests).

Even if this is an anti-pattern that should at least be stated in the best practices section and why. Looking at the builtin ones from my helm chart don't use any difference in their names, but the best practices section is heavily opinionated that the name should be derived from what you're doing.

Additionally, is there documentation explaining recording rules and performance best practices? I've seen blog entries that explains that compute is being distributed, but doesn't exactly say why. In the doc it seems to make a rule for each operation. That seems like it's exploding how many metrics you have, so it'd be nice to understand why this is the better approach and how it works under the covers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing best-practices section on recording rules and the current documentation on recording-rule performance. Review how naming guidance handles filtered expressions, then document the expected naming approach and explain the performance and metric-cardinality tradeoffs. Done means both questions are addressed clearly in the relevant documentation.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.