question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support to assign dynamic tag into existing metric

See original GitHub issue

From slack thread it would be nice to have ability to define only dynamic part in metric while metric with static tags can be defined only once:

registry.timer("my.timer", "static", "tag", "response", response.status()).record(1);

->

Timer myTimer = registry.timer("my.timer", "static", "tag")
...
myTimer.withTags("response", response.status()).record(1);

where withTags returns new instance of timer with additional tags attached.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:58
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
jkschneidercommented, Oct 27, 2018

@zeratul021 It is possible to use dynamic tags now though, simply by registering it as you use it. If the meter already exists, Micrometer will return the existing one.

3reactions
hanagiatcommented, Dec 20, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot Metrics with Dynamic Tag Values - DZone
In our message receiver constructor, we create a TaggedCounter, noting the name of the counter and the name of the tag. No values....
Read more >
Dynamic tag values for the Counter metric in Micrometer
I'm stuck here and have to create different counter variables for each combination of tag values and the readability of the code gets...
Read more >
Dynamic Meters and Metrics with Micrometer | by Aviad Pines
Since in Micrometer, a meter ID is defined by its name and tags (key-value pairs), the tag value determines the meter, and different...
Read more >
Using dynamic labels - Amazon CloudWatch
If you use a dynamic label with a search expression, the dynamic label applies to every metric returned by the search. You can...
Read more >
Assigning Tags - Datadog Docs
Assign host tags in the UI using the Host Map page. Click on any hexagon (host) to show the host overlay on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found