Skip to content

Add Child notion to client #35

Closed
Closed

Description

@brian-brazil

Currently labels are handled by being the first argument to all functions. This gives the incorrect impression that all metrics should labels (in reality most metrics don't have labels) and makes label-less use harder.

This client should follow the structure laid out in https://prometheus.io/docs/instrumenting/writing_clientlibs/#labels

In addition the user should be required to specify all their label names at metric creation time.

Activity

  1. added this to the v0.7.0 milestone on Nov 3, 2016
  2. self-assigned this
    on Nov 3, 2016
  3. grobie commented on Nov 3, 2016

    @grobie
    Member

    Label-less use does not get harder by having an optional labels parameter. See the first example from the readme. This is a common ruby pattern.

    http_requests = prometheus.counter(:http_requests, 'A counter of HTTP requests made')
    
    # start using the counter
    http_requests.increment

    Using a labels() method and calling metric functions on that will help performance-wise though. I added this to milestone v0.7.0.

  4. brian-brazil commented on Nov 3, 2016

    @brian-brazil
    Author

    Label-less use does not get harder by having an optional labels parameter.

    The labels parameter is first, so if you want a non-default value it makes it harder.

  5. removed their assignment
    on Nov 3, 2016
  6. modified the milestones: v0.7.0, v0.8.0 on May 5, 2017
  7. dmagliola commented on Jun 22, 2019

    @dmagliola
    Contributor

    @brian-brazil this is now covered as part of the changes we made in PR #95. We require labels at creation time, they're no longer the first parameter, and the Child notion is implemented through the with_labels methods.

    I'm going to close this issue due to this but feel free to reopen if you think there's still work to do on this.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions