Skip to content

Bring client lib in line with guidelines #218

@beorn7

Description

@beorn7

Umbrella issue to track minor things that are not handled in other issues.

Naming in MetricVec:

  • Reset → Clear
  • Delete / DeleteLabelValues → Remove / RemoveLabelValues

N.B.: With will not be changed into Labels as that would result in stutter, which is highly unidiomatic in Go:
errors.With{Labels{"type":"critical"}).Inc() vs errors.Labels{Labels{"type":"critical"}).Inc() (Consolation: Labels is in there somewhere.) The doc comment of With could mention, though, that this method is usually called Labels in other libraries.

Summaries

Remove the default objectives.

Counter / Gauge interface

The doc comment for Inc and Dec has to point to Add and Sub.

We might consider using a variadic Inc and Dec to emulate overloading, i.e.

cnt.Inc(2) // Inc by 2.
cnt.Inc(2, 3) // Inc by 5.
cnt.Inc() // Inc by 1, not 0!

This might come in handy if incrementing by multiple values (but it's probably rare), and it would reduce the number of methods on Gauge and Counter. I'm a bit unsure about the semantic inconsistency that cnt.Inc() increments by 1 and not by 0. (Feedback welcome!)

Untyped

Only provide it for ConstMetrics. No reason to have it in direct instrumentation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions