prometheus / prometheus/client_js

enhancement: Cluster worker scrape timeouts/errors should be recorded

Open
#290 12 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
JavaScript
Stars
3.5k
Forks
429
Avg merge
3d 3h
Merged PRs (30d)
22

Description

If a worker is heavily loaded or otherwise pathologically performant, a cluster master may time out when scraping that worker (https://github.com/siimon/prom-client/blob/master/lib/cluster.js#L51-L61). The cluster master then returns an incomplete set of data (since some subset of workers have returned data, but not necessarily all). I think it makes sense to record an error counter for clustered worker scrapes, such that it's exposed to downstream consumers.

If this feature makes sense, I am happy to implement it! (cc @dt-rush)

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 in lib/cluster.js at lines 51-61, where the cluster master scrapes workers and handles timeout or error cases. Trace the existing scrape behavior and tests, then verify that worker scrape timeouts and errors are represented by an exposed error counter without losing the existing scrape results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
backend, observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.