prometheus / prometheus/client_js

Default aggregator types

Open
#848 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.5k
Forks
429
Avg merge
3d 3h
Merged PRs (30d)
22

Description

In the most recent release, I made a category error when filtering statistics for the shutdown() code path.

A community member was quick to point out the error and file a PR to fix it, so we got a hotfix out before most people had even discovered the new release.

This has been bugging me ever since because it feels like a footgun. Burying this assumption down in the aggregate() code makes it a bit of tribal knowledge instead of something people can discover for themselves.

So I'm thinking out loud about whether we should be setting a default aggregator in metric.js, gauge.js, histogram.js, etc such that a person sitting at a breakpoint trying to figure out why their graphs aren't graphing has a better chance of catching a problem such as the wrong aggregator being picked for their stat, instead of leaving it to collection time. My feeling is that the average user will look in the vicinity of when a stat is recorded rather than when it is scraped.

Contributor guide

No contributing guide indexed for this repository

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 reading metric.js, gauge.js, and histogram.js, then trace the aggregate() path and where collection occurs. The issue proposes defaults but does not define which aggregator belongs to each type or provide acceptance criteria, so the expected behavior and tests need to be established before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.