diff --git a/packages/azure_ai_foundry/_dev/build/docs/README.md b/packages/azure_ai_foundry/_dev/build/docs/README.md index 477d5bad3a5..3d2294043c4 100644 --- a/packages/azure_ai_foundry/_dev/build/docs/README.md +++ b/packages/azure_ai_foundry/_dev/build/docs/README.md @@ -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. @@ -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. diff --git a/packages/azure_ai_foundry/changelog.yml b/packages/azure_ai_foundry/changelog.yml index 7208667e638..69a8a2a89e1 100644 --- a/packages/azure_ai_foundry/changelog.yml +++ b/packages/azure_ai_foundry/changelog.yml @@ -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. diff --git a/packages/azure_ai_foundry/data_stream/agent_metrics/agent/stream/stream.yml.hbs b/packages/azure_ai_foundry/data_stream/agent_metrics/agent/stream/stream.yml.hbs new file mode 100644 index 00000000000..7a53900ef3f --- /dev/null +++ b/packages/azure_ai_foundry/data_stream/agent_metrics/agent/stream/stream.yml.hbs @@ -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 + 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}} diff --git a/packages/azure_ai_foundry/data_stream/agent_metrics/elasticsearch/ingest_pipeline/default.yml b/packages/azure_ai_foundry/data_stream/agent_metrics/elasticsearch/ingest_pipeline/default.yml new file mode 100644 index 00000000000..832cd679d9c --- /dev/null +++ b/packages/azure_ai_foundry/data_stream/agent_metrics/elasticsearch/ingest_pipeline/default.yml @@ -0,0 +1,31 @@ +--- +description: Pipeline for parsing Microsoft Foundry agent metrics. +processors: + - rename: + field: azure.metrics + target_field: azure.ai_foundry.agent + ignore_missing: true + + - rename: + field: azure.ai_foundry.agent.inputtokens.total + target_field: azure.ai_foundry.agent.input_tokens.total + ignore_missing: true + + - rename: + field: azure.ai_foundry.agent_outputtokens.total + target_field: azure.ai_foundry.agent.output_tokens.total + ignore_missing: true + + - rename: + field: azure.ai_foundry.agent_toolcalls.total + target_field: azure.ai_foundry.agent.tool_calls.total + ignore_missing: true + + - rename: + field: azure.ai_foundry.agent_usageindexed_files.total + target_field: azure.ai_foundry.agent.usage_indexed_files.total + ignore_missing: true +on_failure: + - set: + field: error.message + value: '{{ _ingest.on_failure_message }}' diff --git a/packages/azure_ai_foundry/data_stream/agent_metrics/fields/base-fields.yml b/packages/azure_ai_foundry/data_stream/agent_metrics/fields/base-fields.yml new file mode 100644 index 00000000000..5a14a0db278 --- /dev/null +++ b/packages/azure_ai_foundry/data_stream/agent_metrics/fields/base-fields.yml @@ -0,0 +1,22 @@ +- name: data_stream.type + type: constant_keyword + description: Data stream type. +- name: data_stream.dataset + type: constant_keyword + description: Data stream dataset name. +- name: data_stream.namespace + type: constant_keyword + description: Data stream namespace. +- name: dataset.type + type: constant_keyword + description: Dataset type. +- name: dataset.name + type: constant_keyword + description: Dataset name. +- name: dataset.namespace + type: constant_keyword + description: Dataset namespace. +- name: '@timestamp' + type: date + description: Event timestamp. + diff --git a/packages/azure_ai_foundry/data_stream/agent_metrics/fields/fields.yml b/packages/azure_ai_foundry/data_stream/agent_metrics/fields/fields.yml new file mode 100644 index 00000000000..edafe928796 --- /dev/null +++ b/packages/azure_ai_foundry/data_stream/agent_metrics/fields/fields.yml @@ -0,0 +1,45 @@ +- name: azure.ai_foundry + type: group + description: > + Microsoft Foundry agent metrics from Azure Monitor (Category: Agents) + fields: + - name: agent + type: group + description: Agent metrics. + fields: + - name: events.total + type: long + metric_type: gauge + description: Total number of agent events. Tracks all events generated by agents during execution. + - name: input_tokens.total + type: long + metric_type: gauge + description: Number of input tokens (prompts) processed by agents. Applies to agent-based deployments. + - name: messages.total + type: long + metric_type: gauge + description: Number of messages processed by Microsoft Foundry agents. Tracks messages exchanged between users and agents. + - name: output_tokens.total + type: long + metric_type: gauge + description: Number of output tokens (completions) generated by agents. Applies to agent-based deployments. + - name: responses.total + type: long + metric_type: gauge + description: Number of agent responses generated. Tracks the total count of responses sent by agents to users. + - name: runs.total + type: long + metric_type: gauge + description: Number of agent runs executed. Each run represents a complete agent execution cycle from start to finish. + - name: threads.total + type: long + metric_type: gauge + description: Number of agent threads created. Threads represent conversation sessions between users and agents. + - name: tool_calls.total + type: long + metric_type: gauge + description: Number of tool calls made by agents. Tracks function/tool invocations during agent execution. + - name: usage_indexed_files.total + type: long + metric_type: gauge + description: Number of indexed files used by agents. Tracks file-based data retrieval operations in vector stores. diff --git a/packages/azure_ai_foundry/data_stream/agent_metrics/fields/package-fields.yml b/packages/azure_ai_foundry/data_stream/agent_metrics/fields/package-fields.yml new file mode 100644 index 00000000000..854a0bf24c3 --- /dev/null +++ b/packages/azure_ai_foundry/data_stream/agent_metrics/fields/package-fields.yml @@ -0,0 +1,73 @@ +- name: azure + type: group + description: "" + fields: + - name: timegrain + type: keyword + dimension: true + description: > + The Azure metric timegrain + + - name: resource + type: group + description: > + The resource specified + + fields: + - name: type + type: keyword + description: > + The type of the resource + + - name: name + type: keyword + description: > + The name of the resource + + - name: id + type: keyword + dimension: true + description: > + The id of the resource + + - name: group + type: keyword + description: > + The resource group + + - name: tags.* + type: object + object_type: keyword + object_type_mapping_type: "*" + description: > + Azure resource tags. + + - name: namespace + type: keyword + dimension: true + description: > + The namespace selected + + - name: subscription_id + type: keyword + description: > + The subscription ID + + - name: application_id + type: keyword + description: > + The application ID + + - name: dimensions.* + type: object + object_type: keyword + object_type_mapping_type: "*" + description: > + Azure metric dimensions. + + - name: dimensions.fingerprint + type: keyword + description: | + Autogenerated ID representing the fingerprint of the azure.dimensions object + dimension: true + diff --git a/packages/azure_ai_foundry/data_stream/agent_metrics/manifest.yml b/packages/azure_ai_foundry/data_stream/agent_metrics/manifest.yml new file mode 100644 index 00000000000..490a7b67719 --- /dev/null +++ b/packages/azure_ai_foundry/data_stream/agent_metrics/manifest.yml @@ -0,0 +1,21 @@ +type: metrics +title: Collect Microsoft Foundry agent metrics +dataset: azure.ai_foundry.agent +streams: + - input: azure/metrics + enabled: false + vars: + - name: processors + type: yaml + title: Processors + multi: false + required: false + show_user: false + description: > + Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. + + title: Microsoft Foundry agent metrics + description: "Collect Microsoft Foundry agent metrics from Azure Monitor (Category: Agents)" +elasticsearch: + dynamic_dataset: true + dynamic_namespace: true diff --git a/packages/azure_ai_foundry/data_stream/agent_metrics/sample_event.json b/packages/azure_ai_foundry/data_stream/agent_metrics/sample_event.json new file mode 100644 index 00000000000..9d13226d38e --- /dev/null +++ b/packages/azure_ai_foundry/data_stream/agent_metrics/sample_event.json @@ -0,0 +1,110 @@ +{ + "cloud": { + "provider": "azure", + "region": "eastus2" + }, + "agent": { + "name": "docker-fleet-agent", + "id": "dd5751b2-98ee-4abe-a555-617ae627e4e2", + "type": "metricbeat", + "ephemeral_id": "7359ff11-9479-4b9c-83c4-b0ff8ce0d6ee", + "version": "8.18.1" + }, + "@timestamp": "2025-06-16T09:59:00.000Z", + "ecs": { + "version": "8.17.0" + }, + "service": { + "type": "azure" + }, + "data_stream": { + "namespace": "default", + "type": "metrics", + "dataset": "azure.ai_foundry.agent" + }, + "host": { + "hostname": "docker-fleet-agent", + "os": { + "kernel": "6.10.14-linuxkit", + "name": "Wolfi", + "type": "linux", + "family": "", + "version": "20230201", + "platform": "wolfi" + }, + "containerized": false, + "ip": [ + "172.18.0.7" + ], + "name": "docker-fleet-agent", + "mac": [ + "EE-87-F8-35-CB-E5" + ], + "architecture": "aarch64" + }, + "elastic_agent": { + "id": "dd5751b2-98ee-4abe-a555-617ae627e4e2", + "version": "8.18.1", + "snapshot": false + }, + "metricset": { + "period": 300000, + "name": "monitor" + }, + "event": { + "duration": 30818990806, + "agent_id_status": "verified", + "ingested": "2025-06-16T10:02:45Z", + "module": "azure", + "dataset": "azure.ai_foundry.agent" + }, + "azure": { + "subscription_id": "12cabcb4-86e8-404f-a3d2-123456a", + "timegrain": "PT1M", + "resource": { + "name": "ai-muthuhub687016784742", + "id": "/subscriptions/12cabcb4-86e8-404f-a3d2-123456/resourceGroups/rg-mp-0034_ai/providers/Microsoft.CognitiveServices/accounts/ai-muthuhub6870112345/projects/my-agent-project", + "type": "Microsoft.CognitiveServices/accounts/projects", + "group": "rg-mp-0034_ai" + }, + "namespace": "Microsoft.CognitiveServices/accounts/projects", + "ai_foundry": { + "agent": { + "events": { + "total": 156 + }, + "input_tokens": { + "total": 4521 + }, + "messages": { + "total": 25 + }, + "output_tokens": { + "total": 1893 + }, + "responses": { + "total": 12 + }, + "runs": { + "total": 8 + }, + "threads": { + "total": 5 + }, + "tool_calls": { + "total": 18 + }, + "usage_indexed_files": { + "total": 42 + } + } + }, + "dimensions": { + "region": "eastus2", + "agent_id": "agent-12345", + "model_name": "gpt-4o", + "event_type": "message_created", + "run_status": "completed" + } + } +} diff --git a/packages/azure_ai_foundry/data_stream/metrics/manifest.yml b/packages/azure_ai_foundry/data_stream/metrics/manifest.yml index db42b3a8d26..b4f01179b14 100644 --- a/packages/azure_ai_foundry/data_stream/metrics/manifest.yml +++ b/packages/azure_ai_foundry/data_stream/metrics/manifest.yml @@ -3,58 +3,9 @@ title: Collect Microsoft Foundry metrics dataset: azure.ai_foundry streams: - input: azure/metrics + title: Microsoft Foundry metrics + description: Collect Microsoft Foundry metrics vars: - - name: client_id - type: text - title: Client ID - multi: false - required: true - show_user: true - - name: client_secret - type: text - title: Client Secret - multi: false - required: true - show_user: true - secret: true - - name: tenant_id - type: text - title: Tenant ID - multi: false - required: true - show_user: true - - name: subscription_id - type: text - title: Subscription ID - multi: false - required: true - show_user: true - - name: refresh_list_interval - type: text - title: Refresh list interval - multi: false - required: false - show_user: true - default: 600s - - name: period - type: text - title: Period - multi: false - required: true - show_user: true - default: 300s - - name: resource_groups - type: text - title: Resource Groups - multi: true - required: false - show_user: true - - name: resource_ids - type: text - title: Resource IDs - multi: true - required: false - show_user: true - name: processors type: yaml title: Processors @@ -64,8 +15,6 @@ streams: description: > Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. - title: Azure AI Foundry metrics - description: Collect AI Foundry metrics elasticsearch: # Ensures agents have permissions to write data to `metrics-*-*` dynamic_dataset: true diff --git a/packages/azure_ai_foundry/docs/README.md b/packages/azure_ai_foundry/docs/README.md index 511de95bcf8..0e25aa30aa7 100644 --- a/packages/azure_ai_foundry/docs/README.md +++ b/packages/azure_ai_foundry/docs/README.md @@ -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. @@ -327,6 +336,162 @@ For more details on ECS fields, check the [ECS Field Reference](https://www.elas | data_stream.type | Data stream type. | constant_keyword | +### Agent metrics reference + +The Microsoft Foundry agent metrics provide visibility into agent activity and usage, such as token consumption, runs, and tool calls. + +An example event for `agent` looks as following: + +```json +{ + "cloud": { + "provider": "azure", + "region": "eastus2" + }, + "agent": { + "name": "docker-fleet-agent", + "id": "dd5751b2-98ee-4abe-a555-617ae627e4e2", + "type": "metricbeat", + "ephemeral_id": "7359ff11-9479-4b9c-83c4-b0ff8ce0d6ee", + "version": "8.18.1" + }, + "@timestamp": "2025-06-16T09:59:00.000Z", + "ecs": { + "version": "8.17.0" + }, + "service": { + "type": "azure" + }, + "data_stream": { + "namespace": "default", + "type": "metrics", + "dataset": "azure.ai_foundry.agent" + }, + "host": { + "hostname": "docker-fleet-agent", + "os": { + "kernel": "6.10.14-linuxkit", + "name": "Wolfi", + "type": "linux", + "family": "", + "version": "20230201", + "platform": "wolfi" + }, + "containerized": false, + "ip": [ + "172.18.0.7" + ], + "name": "docker-fleet-agent", + "mac": [ + "EE-87-F8-35-CB-E5" + ], + "architecture": "aarch64" + }, + "elastic_agent": { + "id": "dd5751b2-98ee-4abe-a555-617ae627e4e2", + "version": "8.18.1", + "snapshot": false + }, + "metricset": { + "period": 300000, + "name": "monitor" + }, + "event": { + "duration": 30818990806, + "agent_id_status": "verified", + "ingested": "2025-06-16T10:02:45Z", + "module": "azure", + "dataset": "azure.ai_foundry.agent" + }, + "azure": { + "subscription_id": "12cabcb4-86e8-404f-a3d2-123456a", + "timegrain": "PT1M", + "resource": { + "name": "ai-muthuhub687016784742", + "id": "/subscriptions/12cabcb4-86e8-404f-a3d2-123456/resourceGroups/rg-mp-0034_ai/providers/Microsoft.CognitiveServices/accounts/ai-muthuhub6870112345/projects/my-agent-project", + "type": "Microsoft.CognitiveServices/accounts/projects", + "group": "rg-mp-0034_ai" + }, + "namespace": "Microsoft.CognitiveServices/accounts/projects", + "ai_foundry": { + "agent": { + "events": { + "total": 156 + }, + "input_tokens": { + "total": 4521 + }, + "messages": { + "total": 25 + }, + "output_tokens": { + "total": 1893 + }, + "responses": { + "total": 12 + }, + "runs": { + "total": 8 + }, + "threads": { + "total": 5 + }, + "tool_calls": { + "total": 18 + }, + "usage_indexed_files": { + "total": 42 + } + } + }, + "dimensions": { + "region": "eastus2", + "agent_id": "agent-12345", + "model_name": "gpt-4o", + "event_type": "message_created", + "run_status": "completed" + } + } +} +``` + +**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. + +**Exported fields** + +| Field | Description | Type | Metric Type | +|---|---|---|---| +| @timestamp | Event timestamp. | date | | +| azure.ai_foundry.agent.events.total | Total number of agent events. Tracks all events generated by agents during execution. | long | gauge | +| azure.ai_foundry.agent.input_tokens.total | Number of input tokens (prompts) processed by agents. Applies to agent-based deployments. | long | gauge | +| azure.ai_foundry.agent.messages.total | Number of messages processed by Microsoft Foundry agents. Tracks messages exchanged between users and agents. | long | gauge | +| azure.ai_foundry.agent.output_tokens.total | Number of output tokens (completions) generated by agents. Applies to agent-based deployments. | long | gauge | +| azure.ai_foundry.agent.responses.total | Number of agent responses generated. Tracks the total count of responses sent by agents to users. | long | gauge | +| azure.ai_foundry.agent.runs.total | Number of agent runs executed. Each run represents a complete agent execution cycle from start to finish. | long | gauge | +| azure.ai_foundry.agent.threads.total | Number of agent threads created. Threads represent conversation sessions between users and agents. | long | gauge | +| azure.ai_foundry.agent.tool_calls.total | Number of tool calls made by agents. Tracks function/tool invocations during agent execution. | long | gauge | +| azure.ai_foundry.agent.usage_indexed_files.total | Number of indexed files used by agents. Tracks file-based data retrieval operations in vector stores. | long | gauge | +| azure.application_id | The application ID | keyword | | +| azure.dimensions.\* | Azure metric dimensions. | object | | +| azure.dimensions.fingerprint | Autogenerated ID representing the fingerprint of the azure.dimensions object | keyword | | +| azure.namespace | The namespace selected | keyword | | +| azure.resource.group | The resource group | keyword | | +| azure.resource.id | The id of the resource | keyword | | +| azure.resource.name | The name of the resource | keyword | | +| azure.resource.tags.\* | Azure resource tags. | object | | +| azure.resource.type | The type of the resource | keyword | | +| azure.subscription_id | The subscription ID | keyword | | +| azure.timegrain | The Azure metric timegrain | keyword | | +| data_stream.dataset | Data stream dataset name. | constant_keyword | | +| data_stream.namespace | Data stream namespace. | constant_keyword | | +| data_stream.type | Data stream type. | constant_keyword | | +| dataset.name | Dataset name. | constant_keyword | | +| dataset.namespace | Dataset namespace. | constant_keyword | | +| dataset.type | Dataset type. | constant_keyword | | + + ### 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. diff --git a/packages/azure_ai_foundry/manifest.yml b/packages/azure_ai_foundry/manifest.yml index 63387582682..d7f584fbe24 100644 --- a/packages/azure_ai_foundry/manifest.yml +++ b/packages/azure_ai_foundry/manifest.yml @@ -1,7 +1,7 @@ format_version: 3.4.0 name: azure_ai_foundry title: "Microsoft Foundry" -version: "0.8.0" +version: "0.9.0" source: license: "Elastic-2.0" description: "Collects Microsoft Foundry logs and metrics" @@ -62,6 +62,7 @@ policy_templates: data_streams: - logs - metrics + - agent_metrics categories: - azure - cloud @@ -74,6 +75,58 @@ policy_templates: title: "Collect Microsoft Foundry metrics" description: "Collecting Microsoft Foundry metrics" input_group: metrics + vars: + - name: client_id + type: text + title: Client ID + multi: false + required: true + show_user: true + - name: client_secret + type: text + title: Client Secret + multi: false + required: true + show_user: true + secret: true + - name: tenant_id + type: text + title: Tenant ID + multi: false + required: true + show_user: true + - name: subscription_id + type: text + title: Subscription ID + multi: false + required: true + show_user: true + - name: refresh_list_interval + type: text + title: Refresh list interval + multi: false + required: false + show_user: true + default: 600s + - name: period + type: text + title: Period + multi: false + required: true + show_user: true + default: 300s + - name: resource_groups + type: text + title: Resource Groups + multi: true + required: false + show_user: true + - name: resource_ids + type: text + title: Resource IDs + multi: true + required: false + show_user: true owner: github: elastic/obs-infraobs-integrations type: elastic