Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize metrics with labels to 0 #641

Open
robrichard opened this issue Oct 2, 2024 · 0 comments · May be fixed by #642
Open

Initialize metrics with labels to 0 #641

robrichard opened this issue Oct 2, 2024 · 0 comments · May be fixed by #642

Comments

@robrichard
Copy link

robrichard commented Oct 2, 2024

In #139 metrics without labels are initialized to 0 when created. Would it be possible to have a function that can initialize metrics with labels to 0 for a known set of label values? Something like:

const summary = new promClient.Summary({
    name: 'http_request_duration_seconds',
    labelNames: labels
});
summary.init({"response_status": "success"});
summary.init({"response_status": "error"});
@robrichard robrichard linked a pull request Oct 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant