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.

Is it possible to change the default RequestDuration's options?

See original GitHub issue

Is there a way to customize the default histogram used by the UseHttpMetrics middleware? I’d like to have custom buckets and an extra label for the request route. I couldn’t find any documentation to do this. Let me know if I’ve missed it.

Thanks

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
robertocpsilva1commented, May 17, 2020

That was it, thank you!

0reactions
Jeff-Tiancommented, Nov 14, 2022

Finally fixed the above issue by

app.UseHttpMetrics(opt => {
                opt.RequestDuration.Histogram = Metrics.CreateHistogram("app_specific_name", "app_specific_help",
                new HistogramConfiguration
                {
                    Buckets = Histogram.ExponentialBuckets(0.001, 2, 16),
                    LabelNames = HttpRequestLabelNames.All.concat(new [] {"xxx"}).toArray()
                });

                opt.AddCustomLabel("xxx", _ => "yyy");
            });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging in .NET Core and ASP.NET Core
Learn how to use the logging framework provided by the Microsoft. ... The following code overrides the default set of logging providers ...
Read more >
Viewing system configuration settings
The guide contains the following details for each setting: Description of the setting; Default value; Recommended values; First version containing the setting ......
Read more >
Set up Lambda proxy integrations in API Gateway
Learn how to configure a Lambda proxy integration request and integration response in API Gateway.
Read more >
How to set default xmlns with zeep in Python?
I did some research but did not find a way to set the default namespace (xmlns) to https://xml.dbcarsharing-buchung.de/hal2_cabserver/.
Read more >
Dropwizard Configuration Reference
By default, the timestamp is not formatted. To customize how timestamps are formatted, set the property to the corresponding DateTimeFormatter string or one...
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