Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/azure_ai_foundry/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ Enable the category `Logs related to ApiManagement Gateway` to stream the logs t
└──────────────────┘ └──────────────┘ └─────────────────┘
```

> **Upgrade note**
If you are upgrading from a previous version to 0.9.0, the metrics configuration (for example, `client_id`, `client_secret`, `tenant_id`, `subscription_id`) has moved out of the metrics data stream and into the policy template. While upgrading, review your integration policy and re-enter these values.

### Agent metrics

The agent metrics data stream collects Microsoft Foundry **Agents** metrics from Azure Monitor (Category: Agents). These metrics help you monitor agent activity and usage, such as event volume, token consumption, runs, and tool calls.

Agent metrics are available under the `azure.ai_foundry.agent.*` field namespace (for example, `azure.ai_foundry.agent.input_tokens.total` and `azure.ai_foundry.agent.tool_calls.total`).

### Metrics

The metrics data stream collects the cognitive service metrics that is specific to the Microsoft Foundry service.
Expand Down Expand Up @@ -84,6 +93,18 @@ For more details on ECS fields, check the [ECS Field Reference](https://www.elas

{{fields "logs"}}

### Agent metrics reference

The Microsoft Foundry agent metrics provide visibility into agent activity and usage, such as token consumption, runs, and tool calls.

{{event "agent_metrics"}}

**ECS Field Reference**

For more details on ECS fields, check the [ECS Field Reference](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html) documentation.

{{fields "agent_metrics"}}

### Metrics reference

The Microsoft Foundry metrics provide insights into the performance and usage of your AI resources. These metrics help in monitoring and optimizing your deployments.
Expand Down
5 changes: 5 additions & 0 deletions packages/azure_ai_foundry/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- version: "0.9.0"
changes:
- description: Add agent metrics datastream.
type: enhancement
link: https://github.com/elastic/integrations/pull/17422
- version: "0.8.0"
changes:
- description: Rebrand Azure AI Foundry to Microsoft Foundry.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
metricsets: ["monitor"]
period: {{period}}
{{#if client_id}}
client_id: {{client_id}}
{{/if}}
{{#if client_secret}}
client_secret: {{client_secret}}
{{/if}}
{{#if tenant_id}}
tenant_id: {{tenant_id}}
{{/if}}
{{#if subscription_id}}
subscription_id: {{subscription_id}}
{{/if}}
{{#if refresh_list_interval}}
refresh_list_interval: {{refresh_list_interval}}
{{/if}}
{{#if resource_manager_endpoint}}
resource_manager_endpoint: {{resource_manager_endpoint}}
{{/if}}
resources:
{{#if resource_groups}}
{{#each resource_groups}}
- resource_group: "{{this}}"
resource_type: "Microsoft.CognitiveServices/accounts/projects"
metrics:
- name:
- AgentEvents
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
Comment on lines +25 to +31
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the resource_groups branch, the metrics blocks use namespace: "Microsoft.CognitiveServices/accounts" while the resource type is Microsoft.CognitiveServices/accounts/projects (and the default resource_query branch uses /accounts/projects). This mismatch will query the wrong Azure Monitor namespace for project-scoped agent metrics; update these namespaces to Microsoft.CognitiveServices/accounts/projects for consistency.

Copilot uses AI. Check for mistakes.
dimensions:
- name: EventType
value: '*'
- name:
- AgentInputTokens
- AgentOutputTokens
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: TokenType
value: '*'
- name:
- AgentMessages
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name: ThreadId
value: '*'
- name:
- AgentResponses
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: ResponseStatus
value: '*'
- name:
- AgentRuns
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: RunStatus
value: '*'
- name: StatusCode
value: '*'
- name: StreamType
value: '*'
- name: ThreadId
value: '*'
- name:
- AgentThreads
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name:
- AgentToolCalls
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: ToolName
value: '*'
- name:
- AgentUsageIndexedFiles
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: ErrorCode
value: '*'
- name: Status
value: '*'
- name: VectorStoreId
value: '*'
{{/each}}
{{/if}}
{{#if resource_ids}}
{{#each resource_ids}}
- resource_id: "{{this}}"
metrics:
- name:
- AgentEvents
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name:
- AgentInputTokens
- AgentOutputTokens
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: TokenType
value: '*'
- name:
- AgentMessages
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name: ThreadId
value: '*'
- name:
- AgentResponses
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: ResponseStatus
value: '*'
- name:
- AgentRuns
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: RunStatus
value: '*'
- name: StatusCode
value: '*'
- name: StreamType
value: '*'
- name: ThreadId
value: '*'
- name:
- AgentThreads
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name:
- AgentToolCalls
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: ToolName
value: '*'
- name:
- AgentUsageIndexedFiles
namespace: "Microsoft.CognitiveServices/accounts"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: ErrorCode
value: '*'
- name: Status
value: '*'
- name: VectorStoreId
value: '*'
{{/each}}
{{/if}}

{{!
When no resource group and resource ID are specified by the user, collect
metrics for all the resource groups in the subscription for the
Microsoft.CognitiveServices/accounts resources.
}}

{{#unless resource_ids }}
{{#unless resource_groups }}
- resource_query: "resourceType eq 'Microsoft.CognitiveServices/accounts/projects'"
metrics:
- name:
- AgentEvents
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name:
- AgentInputTokens
- AgentOutputTokens
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: TokenType
value: '*'
- name:
- AgentMessages
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name: ThreadId
value: '*'
- name:
- AgentResponses
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: ResponseStatus
value: '*'
- name:
- AgentRuns
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: RunStatus
value: '*'
- name: StatusCode
value: '*'
- name: StreamType
value: '*'
- name: ThreadId
value: '*'
- name:
- AgentThreads
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: EventType
value: '*'
- name:
- AgentToolCalls
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: AgentId
value: '*'
- name: ModelName
value: '*'
- name: ToolName
value: '*'
- name:
- AgentUsageIndexedFiles
namespace: "Microsoft.CognitiveServices/accounts/projects"
timegrain: "PT1M"
ignore_unsupported: true
dimensions:
- name: ErrorCode
value: '*'
- name: Status
value: '*'
- name: VectorStoreId
value: '*'
{{/unless}}
{{/unless}}
{{#if processors}}
processors:
{{processors}}
{{/if}}
Loading
Loading