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.

Wiki: Need to add parameter in labels

See original GitHub issue

What is recommended way for adding Parameter in metrics… ?

I mean, Currently we have: invocation_by_type_created{item_type="hey"} 1.5603457069620097e+09 Which can be achieved by:

@metrics.counter('invocation_by_type', 'Number of invocations by type',
         labels={'item_type': "hey"})
def echo_status(status):
    return 'Status: %s' % status, status

Now, We need to have some timedelta included in output metrics, something like: invocation_by_type_created{item_type="hey", timedelta=52} 1.5603457069620097e+09

which is ofcause the function execution time…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
deepak1725commented, Jun 13, 2019

Thanks! It helped

0reactions
rycus86commented, Jun 13, 2019

You can have more than one labels, and they accept functions or lambdas for values that are evaluated in the request context. See usage at https://github.com/rycus86/prometheus_flask_exporter/blob/master/README.md#usage

Is this what you’re after?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help:Template - Wikipedia
A template is a Wikipedia page created to be included in other pages. Templates usually contain repetitive material that might need to show...
Read more >
Template:Expert needed - Wikipedia
This template flags an article for the badly-needed attention of an expert or experts in the subject(s) specified (please use {{Expert needed talk}}...
Read more >
Wikipedia:TemplateData/Tutorial
The "label" entry is a human-readable title for the parameter that will be displayed within the template editor. · Enter the parameter's "description"...
Read more >
Template:Template parameter usage - Wikipedia
The Template Parameters tool is available for viewing template parameter usage in articles. It works with TemplateData to show the frequency of parameter...
Read more >
Template:Note label - Wikipedia
The first parameter of {{ref}} is a label that has to be used for the parameter of the corresponding {{note}}. The label is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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