Skip to content

Reimplement 'labels' as a derivative of the Metric instead of a closure #812

Description

@jdmarshall

With the existence of LabelMap, there are simpler mechanisms available to give multiple callers a set of labels to apply to all metrics calls.

Problem areas:

  • copy constructor
  • reset - I already have a TODO in the code about how reset is poorly implemented, and this will need to be fixed.
  • metrics gathering - a derived metric has already had its stats reported and should return empty set

In the bargain however, this one feature addresses #777, #407, and #598 all without introducing performance regressions.

Additional Concerns

Based on conversation in #813, it would be useful for consistency with the other client implementations if, when all of the labels have been captured (full coverage versus #407's currying suggestion) that the derived gauge be initialized to 0 if it is not already in the store.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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