canonical: https://jentic.com/apis/azure.com/azure-metrics

# Microsoft Azure Azure Metrics

Jentic publishes the only available OpenAPI specification for Azure Metrics, keeping it validated and agent-ready. The Azure Metrics API lets clients submit custom metric data points to the Azure Monitor metrics store via a single regional ingestion endpoint at monitoring.azure.com. It is the publishing side of the Azure Monitor metrics pipeline, used by applications and infrastructure to record numeric time-series data tied to a specific Azure resource. Once ingested, these metrics can be queried, charted, and alerted on through Azure Monitor.

## For AI agents

Publish custom metric data points for an Azure resource into the Azure Monitor metrics store. Useful when an agent needs to emit numeric telemetry tied to a subscription, resource group, and resource name.

## Scope

Does not handle log ingestion, trace ingestion, or metric querying - use for publishing custom numeric metrics to Azure Monitor only.

## Capabilities

- Publish a batch of custom metric values for an Azure resource at a specific timestamp
- Tag emitted metrics with namespace, name, and dimension values for later filtering in Azure Monitor
- Scope metric submissions to a subscription, resource group, resource provider, and resource type
- Send numeric time-series data into the Azure Monitor metrics pipeline for charts and alerts
- Record application-level counters that complement the platform metrics Azure already collects

## Use cases

### Custom Application Metrics

Publish application-level numeric metrics (request rate, queue depth, error count) against the Azure resource that hosts the workload. The Azure Metrics ingestion endpoint accepts a batch of values with namespace, name, and dimensions, and stores them in Azure Monitor for charting and alerting alongside platform metrics. A single POST per emit cycle is enough to instrument a service.

Example prompt: POST a custom metric named 'request_count' with value 42 and dimension 'endpoint=/checkout' against a specific App Service resource using the Metrics_Create operation.

### Telemetry From Background Jobs

Background workers and scheduled jobs running outside Application Insights can still emit health and throughput numbers by sending them to the Azure Metrics endpoint. Each call records a metric value tied to the Azure resource that owns the job, so dashboards and alert rules in Azure Monitor see the same shape of data as platform metrics.

Example prompt: Emit a 'job_duration_seconds' metric with value 12.5 for the resource hosting the worker after each job run using a POST to the metrics path.

### Threshold Alerting On Custom Signals

Azure Monitor alert rules trigger on metric values regardless of whether the metric was emitted by the platform or a custom source. By publishing custom values through the Azure Metrics API, teams gain the ability to alert on signals Azure does not collect natively, such as business KPIs or third-party integration health, without standing up a separate monitoring stack.

Example prompt: POST a custom 'failed_payments_per_minute' metric so an existing Azure Monitor alert rule can fire when the value exceeds a configured threshold.

### AI Agent Telemetry Ingestion

An agent acting on Azure resources can publish operational telemetry about its own actions (operations attempted, latency, retry count) to Azure Monitor via the Metrics ingestion endpoint. Through Jentic, the agent searches for the Azure Metrics operation by intent, loads the input schema, and POSTs values without manually constructing the long subscription/resource-provider/resource path.

Example prompt: Use Jentic to call the Azure Metrics POST operation and emit an 'agent_action_count' metric tagged with agent_id and outcome dimensions after each tool invocation.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProvider}/{resourceTypeName}/{resourceName}/metrics | Publish a batch of custom metric values for an Azure resource |

## Key resources

- **Metrics** — Single ingestion operation that accepts a batch of metric values targeted at a specific Azure resource path.

## Why Jentic

- **Setup:** Wiring the Azure Metrics ingestion endpoint by hand means acquiring an Azure AD bearer token for the https://monitoring.azure.com/.default scope even though the spec declares no scheme, shaping the time-series payload, and treating 429 responses as a signal to back off and batch. Through Jentic you install once, import Azure Metrics from the API Directory, store the Azure AD credentials once, and your agent calls it.
- **Permission scoping:** This endpoint puts the subscription, resource group, resource provider, resource type, and resource name in the URL path (/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProvider}/{resourceTypeName}/{resourceName}/metrics), so a rule can pin your agent to publishing metrics for one resource. It exposes a single publish operation, so the agent can emit metric values and nothing else unless you add more operations.
- **Credential handling:** Your Azure AD bearer credentials for monitoring.azure.com are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'publish a custom metric to Azure Monitor', and Jentic returns the Metrics_Create operation with its input schema so the agent submits values without hand-constructing the long subscription and resource-provider path.

## Related APIs

- **Monitor Management Client** — Reads metric definitions, alert rules, and diagnostic settings while azure-metrics writes metric values.
- **Application Insights Management Client** — Application Insights ingests richer telemetry (traces, exceptions, dependencies); azure-metrics only handles numeric metrics.
- **Azure Action Groups** — Defines the notification targets that fire when alerts on these custom metrics trigger.

## FAQ

### Why is there no official OpenAPI spec for Azure Metrics?

Microsoft Azure does not publish an OpenAPI specification for the Azure Metrics ingestion endpoint. Jentic generates and maintains this spec so that AI agents and developers can call Azure Metrics via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Azure Metrics API use?

The published spec does not declare a security scheme, but in practice the monitoring.azure.com ingestion endpoint requires an Azure AD bearer token with the `https://monitoring.azure.com/.default` scope. Through Jentic, those tokens are stored in your Jentic One instance and never enter the agent's context.

### Can I publish multiple metric values in one call to Azure Metrics?

Yes. The Metrics_Create POST operation accepts a payload with a time, base data, and dimensions, so one call can carry several metric series for the same resource at the same timestamp.

### What are the rate limits for the Azure Metrics API?

Azure Monitor enforces ingestion limits per region and per resource (documented as throttling on the monitoring.azure.com endpoint). The OpenAPI spec does not encode the exact numbers, so production agents should treat 429 responses as a signal to back off and batch more values per request.

### How do I send a custom metric with the Azure Metrics API through Jentic?

Run pip install jentic, then call client.search('publish a custom metric to Azure Monitor'). Jentic returns the Metrics_Create operation, you load its schema, and execute with subscriptionId, resourceGroupName, the resource path, and the metric payload.

### Does Azure Metrics replace Application Insights?

No. The Azure Metrics ingestion endpoint only handles numeric metric data points. Logs, traces, exceptions, and request telemetry still belong in Application Insights or Log Analytics.

### Can I limit what my agent is allowed to do with the Azure Metrics API?

Yes. Because Jentic One is self-hosted, you set the rules that decide which operations and credentials your agent may use. The Azure Metrics API exposes a single publish operation (Metrics_Create), so your rules can let the agent emit metric values and nothing else. Since the subscription, resource group, resource provider, resource type, and resource name all live in the request path, you can also pin the agent to publishing metrics for one specific Azure resource.
