Skip to content

Document observing/increasing multiple labels #87

Open
@jlouis

Description

@jlouis

Hi!

Thank you for a really nice library!

How do I increase multiple labels in a safe way? Suppose I have something like

prometheus_counter:new([{name, foo}, {help, "foo"}, {labels, [class, status]}])

If I want to bump this counter, I do:

prometheus_counter:inc(foo, [x, success]),
prometheus_counter:inc(foo, [y, failure]),

My question is: what if I add another label or provide the wrong order of labels? Can I send in a map, like:

prometheus_counter:inc(foo, #{ class => x, status => success })

or do I have to be precise? There is no documentation examples of this, and I dug in the tests but found no coverage of this, but perhaps I didn't look with enough conviction :)

So:

I expected

documentation on how one observes multiple labels for an observation/increase.

I found

nothing of this sort in the README.md file. If I run into this, surely others are going to do the same, so if there is documentation somewhere, please make this into a "point to the correct documentation" issue :)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions