项目作者: PrometheusClientNet

项目描述 :
Metrics logging of request durations
高级语言: C#
项目地址: git://github.com/PrometheusClientNet/Prometheus.Client.HttpRequestDurations.git


Prometheus.Client.HttpRequestDurations

ci
nuget
nuget
codecov
license

Installation

  1. dotnet add package Prometheus.Client.HttpRequestDurations

Use

There are Examples

  1. app.UsePrometheusRequestDurations(q =>
  2. {
  3. q.IncludePath = true;
  4. q.IncludeMethod = true;
  5. q.IgnoreRoutesConcrete = new[] // Ignore some concrete routes
  6. {
  7. "/favicon.ico",
  8. "/robots.txt",
  9. "/"
  10. };
  11. q.IgnoreRoutesStartWith = new[]
  12. {
  13. "/swagger" // Ignore '/swagger/*'
  14. };
  15. q.CustomNormalizePath = new Dictionary<Regex, string>
  16. {
  17. { new Regex(@"\/[0-9]{1,}(?![a-z])"), "/id" } // Replace 'int' in Route
  18. };
  19. });

Contribute

Contributions to the package are always welcome!

License

All contents of this package are licensed under the MIT license.