prometheus / prometheus/client_js
Pushgateway metrics
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.5k
- Forks
- 429
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 22
Description
const client = require('prom-client');
const collectDefaultMetrics = client.collectDefaultMetrics;
const Registry = client.Registry;
const register = new Registry();
collectDefaultMetrics({ register: register, prefix: 'prefix_' }); //ok, but without prefix
const test = new client.Counter({
name: 'prefix_test',
help: 'prefix_test',
registers: [register]
});
register.registerMetric(test);
test.inc(10); //not ok.
let gateway = new client.Pushgateway('http://127.0.0.1:9091', [], register);
gateway.push({ jobName: 'test' }, function (err, resp, body) {});
I am trying to use Pushgateway. Default metrics pushed successfully but without prefix. But my test counter doesn't push to gateway.
Maybe I missed something? Really lacking a full-featured example with Pushgateway
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests; start with the provided Registry, collectDefaultMetrics, Counter, and Pushgateway.push flow. Compare the default metrics and test counter in the pushed output, then confirm whether the counter is registered and whether prefix handling matches the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, prometheus
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100