Skip to content

azure: emit Azure API rate-limit metrics#666

Draft
HadrienPatte wants to merge 1 commit into
v1.19-ddfrom
hadrien/1.19/azure-metrics
Draft

azure: emit Azure API rate-limit metrics#666
HadrienPatte wants to merge 1 commit into
v1.19-ddfrom
hadrien/1.19/azure-metrics

Conversation

@HadrienPatte
Copy link
Copy Markdown
Member

Azure API responses include X-Ms-Ratelimit-Remaining-* headers that report how much of the request budget is left for the subscription or tenant scope. Surfacing these as Prometheus metrics lets operators see how close they are to throttling before requests start failing.

Add a per-retry pipeline policy (rateLimitMetricsExtractor) that runs inside the azcore client pipeline. On each response it parses the remaining-budget headers and records two new gauges on the existing Azure IPAM allocator Metrics struct:

  • cilium_operator_azure_ratelimit_remaining{description, subscription_id}
  • cilium_operator_azure_ratelimit_remaining_resource{policy, subscription_id}

subscription_id is left empty for tenant-scoped descriptions (tenant-reads, tenant-writes, ...) since the budget is shared across the tenant and labeling it with one subscription would be misleading.

Azure API responses include X-Ms-Ratelimit-Remaining-* headers that
report how much of the request budget is left for the subscription or
tenant scope. Surfacing these as Prometheus metrics lets operators see
how close they are to throttling before requests start failing.

Add a per-retry pipeline policy (rateLimitMetricsExtractor) that runs
inside the azcore client pipeline. On each response it parses the
remaining-budget headers and records two new gauges on the existing
Azure IPAM allocator Metrics struct:

* `cilium_operator_azure_ratelimit_remaining{description, subscription_id}`
* `cilium_operator_azure_ratelimit_remaining_resource{policy, subscription_id}`

subscription_id is left empty for tenant-scoped descriptions
(tenant-reads, tenant-writes, ...) since the budget is shared across
the tenant and labeling it with one subscription would be misleading.

Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
@HadrienPatte HadrienPatte force-pushed the hadrien/1.19/azure-metrics branch from 78405f9 to 549f695 Compare May 8, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant