Configure cloud metrics and logs for Azure API Management self-hosted gateway
This article provides details for configuring cloud metrics and logs for the self-hosted gateway.
The self-hosted gateway has to be associated with an API management service and requires outbound TCP/IP connectivity to Azure on port 443. The gateway leverages the outbound connection to send telemetry to Azure, if configured to do so.
This feature is available in the Premium and Developer tiers of API Management.
For feature availability in the v2 tiers (preview), see the v2 tiers overview.
The feature can be enabled or disabled using the
telemetry.metrics.cloud key in the ConfigMap of the gateway Deployment. Below is a breakdown of the available configurations:
||Enables logging through Azure Monitor. Value can be
Here is a sample configuration:
apiVersion: v1 kind: ConfigMap metadata: name: contoso-gateway-environment data: config.service.endpoint: "<contoso-gateway-management-endpoint>" telemetry.metrics.cloud: "true"
The self-hosted gateway currently emits the following metrics through Azure Monitor:
|Requests||Number of API requests in the period|
|Duration of gateway requests||Number of milliseconds from the moment gateway received request until the moment response sent in full|
|Duration of backend requests||Number of milliseconds spent on overall backend IO (connecting, sending and receiving bytes)|
- To learn more about the observability capabilities of the Azure API Management gateways.
- To learn more about the self-hosted gateway, see Azure API Management self-hosted gateway overview
- Learn about configuring and persisting logs locally