Metrics
This page explains all available metrics which can be collected with OpenTelemetry.
Before you begin¶
Before getting started, make sure to read our overview about OpenTelemetry to learn more about metrics and labels.
Labels¶
Label | Description | Example |
---|---|---|
code |
Request code | "200" |
method |
Request Method | "GET" |
protocol |
Request protocol | "http", "grpc", ... |
user_id |
Unique user identifier | "645133c75d2aee16b07ef3da" (The user_id holds the internal ID or the Keycloak ID, depending on where the user comes from.) |
email |
Email of the token creator user | "[email protected]" |
token_name |
Name of the API key used to authenticate | "my-test-token" |
api_name |
Name of the API | "flight-api" |
api_version_name |
The version of the API | "flight-api-v2" |
api_namespace |
Namespace of the API | "airlines" |
gateway_name |
Name of the API Gateway | "my-gateway" |
agend_id |
Identifier of the Hub Agent | "5d351900-26e0-408a-8f36-2112b50b26ff" |
instance_id |
Pod ID of the Hub Agent instance | "traefik-6d67f77db9-nrrnm" |
tls_version |
TLS version used for the request | "1.0" |
tls_cipher |
TLS cipher used for the request | "TLS_FALLBACK_SCSV" |
portal_type |
Type of the portal | "single_cluster", "multi_cluster" |
portal_name |
Name of the API Portal | "my-api-portal" |
Metrics¶
All Traefik Hub metrics use the prefix traefik_hub_
for example traefik_hub_api_requests_total
.
Dataflow related metrics¶
All metrics use the same labels
code
, method
, protocol
, user_id, email
, token_name
, api_name
, api_version_name
, api_namespace
, gateway_name
, agent_id
, instance_id
, tls_version
, tls_cipher
Metric | Type | Description |
---|---|---|
API request total api_requests_total |
Count | The total count of requests handled by the API |
API request duration api_requests_duration_milliseconds_sum api_requests_duration_milliseconds_count api_requests_duration_milliseconds_bucket |
Histogram | Request processing duration histogram on an API |
API request bytes total api_requests_bytes_total |
Count | The total size of requests in bytes handled by an API (body size) |
API response bytes total api_responses_bytes_total |
Count | The total size of responses in bytes handled by an API (body size) |
License related metrics¶
Metric | Type | Labels | Description |
---|---|---|---|
Current node count api_nodes_ratio |
Gauge | agent_id , instance_id |
Number of nodes hosting microservices serving APIs |
All node count nodes_ratio |
Gauge | agent_id , instance_id |
Number of all nodes in the cluster |
Current portal count portals_ratio |
Gauge | agent_id , instance_id , portal_type |
Number of portals created |
Other API management metrics¶
Metric | Type | Labels | Description |
---|---|---|---|
API gateway count api_gateways_ratio |
Gauge | agent_id , instance_id |
Number of API gateways |
API count apis_ratio |
Gauge | agent_id , instance_id , api_namespace |
Number of APIs |
GW API count api_gateway_apis_ratio |
Gauge | agent_id , instance_id , gateway_name |
Number of APIs published on gateways |
Portal API count api_portal_apis_ratio |
Gauge | agent_id , instance_id , portal_name |
Number of APIs published on portals |
API version count api_versions_ratio |
Gauge | agent_id , instance_id , api_name , api_namespace |
Number of API versions |
API collection count api_collections_ratio |
Gauge | agent_id , instance_id , api_namespace |
Number of API collections |
Rate limit count api_rate_limits_ratio |
Gauge | agent_id , instance_id |
Number of rate limit policies |
API access count api_accesses_ratio |
Gauge | agent_id , instance_id |
Number of API access policies |
API key count api_keys_ratio |
Gauge | agent_id , instance_id , user_id , user_email |
Number of API keys with access to APIs on the agent |
User count with API access users_ratio |
Gauge | agent_id , instance_id |
Number of users that have access to APIs published on the Traefik Hub agent |
User group count with API access user_groups_ratio |
Gauge | agent_id , instance_id |
Number of user groups that have access to APIs published on the Traefik Hub agent |
Metrics related to the Traefik Hub Ingress¶
All metrics use the same labels
agent_id
, instance_id
Metric | Type | Description |
---|---|---|
Edge Ingress count edge_ingresses_ratio |
Gauge | Number of tunnels |
Ingress count ingresses_ratio |
Gauge | Number of general Kubernetes Ingresses |
IngressRoute count ingress_routes_ratio |
Gauge | Number of Traefik Ingresses |
Service count services_ratio |
Gauge | Number of Services |
ACP count acps_ratio |
Gauge | Number of ACPs |
What's next¶
- Learn how to use Prometheus to export your API metrics