22 lines
576 B
Python
22 lines
576 B
Python
from opentelemetry import metrics
|
|
|
|
meter = metrics.get_meter("han.api")
|
|
|
|
HTTP_REQUESTS = meter.create_counter(
|
|
"han_http_requests_total",
|
|
description="Completed HTTP requests",
|
|
)
|
|
HTTP_DURATION = meter.create_histogram(
|
|
"han_http_request_duration_seconds",
|
|
unit="s",
|
|
description="HTTP request duration",
|
|
)
|
|
AUTH_BOOTSTRAP = meter.create_counter(
|
|
"han_auth_bootstrap_total",
|
|
description="Authentication bootstrap outcomes",
|
|
)
|
|
RATE_LIMIT_DECISIONS = meter.create_counter(
|
|
"han_rate_limit_decisions_total",
|
|
description="Rate-limit decisions",
|
|
)
|