You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I noticed that the default metrics contain the metric http_requests_total. As this metric is only defined inside the method default, it was necessary to create it as a custom metric:
defhttp_requests_total(metric_namespace='', metric_subsystem='') ->Callable[[Info], None]:
total=Counter(
name="http_requests_total",
documentation="Total number of requests by method, status and handler.",
labelnames=(
"method",
"status",
"handler",
),
namespace=metric_namespace,
subsystem=metric_subsystem,
)
definstrumentation(info: Info) ->None:
total.labels(info.method, info.modified_status, info.modified_handler).inc()
returninstrumentation
It would be great to have this metric available as a method like latency and response_size.
Thanks!
The text was updated successfully, but these errors were encountered:
Hello, I noticed that the default metrics contain the metric
http_requests_total
. As this metric is only defined inside the methoddefault
, it was necessary to create it as a custom metric:It would be great to have this metric available as a method like
latency
andresponse_size
.Thanks!
The text was updated successfully, but these errors were encountered: