Code Monkey home page Code Monkey logo

Comments (7)

endofcake avatar endofcake commented on May 27, 2024

Turns out it's possible to specify labels in the push URL:

/metrics/job/<JOBNAME>{/<LABEL_NAME>/<LABEL_VALUE>}

This ties nicely with #6.

from nexogen.libraries.metrics.

farkasmark avatar farkasmark commented on May 27, 2024

Thanks for the feedback! Let me get back to you with this issue early next week!

from nexogen.libraries.metrics.

endofcake avatar endofcake commented on May 27, 2024

This looks like a simple fix, so I can submit a PR if you're willing to accept it.

from nexogen.libraries.metrics.

farkasmark avatar farkasmark commented on May 27, 2024

Thanks! Yes, it is very much appreciated! Submit the PR and we can review & accept it on Monday!

from nexogen.libraries.metrics.

ahoka avatar ahoka commented on May 27, 2024

Hi Alexander,

Can't you use it like this?

            ILabelledGauge labelledGauge = metrics.Gauge()
                .Name("test")
                .Help("Test.")
                .LabelNames("robot")
                .Register();

            IGauge wallyGuage = labelledGauge.Labels("WALL-E");
            IGauge johnyGauge = labelledGauge.Labels("Johnny-5");

ILabelledGauge is a builder which assigns the label value to the metric and returns a IGauge .

Or do you have something different in mind?

from nexogen.libraries.metrics.

endofcake avatar endofcake commented on May 27, 2024

@ahoka , yes, I'm thinking about static labels which do not change during the lifetime of the instance (in our case this is a container running on AWS ECS) and should be applied seamlessly to all metrics. Some examples - AWS region, ECS task version, ECS task id, ECS host instance id. All these values can be grabbed from environment variables, but it's quite tedious to remember to do this for dozens of metrics, would be much better to just set them once.
I think using the push URL is a good solution to this, I just need to find time to prepare the PR.

from nexogen.libraries.metrics.

endofcake avatar endofcake commented on May 27, 2024

This is roughly what I was thinking about: #9

from nexogen.libraries.metrics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.