Skip to content

Initialize metrics with labels to 0 #641

@robrichard

Description

@robrichard

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"});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions