mcpField
A
azure-observability

azure-observability

官方
github.com/microsoft数据与数据库1.6k98.2k 次安装今天更新
代码仓库

关于 azure-observability

azure-observability 是面向 Azure 监控与故障排查的技能,适用于需要查看指标、应用性能、日志和告警的运维及开发人员。它汇总 Azure Monitor、Application Insights、Log Analytics、Alerts 和 Workbooks 的 MCP 工具与 CLI 用法,并提供常见 KQL 查询示例。

主要功能

  1. 01查询指标与日志
  2. 02查看应用性能和分布式追踪
  3. 03使用 KQL 查询日志
  4. 04管理告警与交互式报告
  5. 05提供常见监控策略

适用场景

  1. 01排查应用异常和失败请求
  2. 02分析响应时间与依赖
  3. 03检查基础设施资源指标
  4. 04查询安全审计日志

MCP 相关

Azure MCP 启用时,技能优先使用其工具查询 Azure Monitor 指标和日志、列出 Application Insights 资源,以及列出 Kusto 集群并执行 KQL 查询。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/microsoft/azure-skills --skill azure-observability

安装后在 Claude Code 中输入/azure-observability确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

references/
auth-best-practices.md
references/sdk/
azure-mgmt-applicationinsights-dotnet.md
azure-monitor-ingestion-java.md
azure-monitor-ingestion-py.md
azure-monitor-opentelemetry-exporter-py.md
azure-monitor-opentelemetry-py.md
azure-monitor-opentelemetry-ts.md
azure-monitor-query-java.md
azure-monitor-query-py.md

详细介绍

Azure 可观测性服务

服务

服务适用场景MCP 工具CLI
Azure Monitor指标、警报、仪表板azure__monitoraz monitor
Application InsightsAPM、分布式跟踪azure__applicationinsightsaz monitor app-insights
Log Analytics日志查询、KQLazure__kustoaz monitor log-analytics
Alerts通知、操作-az monitor alert
Workbooks交互式报告azure__workbooks-

MCP 服务(首选)

启用 Azure MCP 后:

Monitor
  • azure__monitor,命令为 monitor_metrics_query - 查询指标
  • azure__monitor,命令为 monitor_logs_query - 使用 KQL 查询日志
Application Insights
  • azure__applicationinsights,命令为 applicationinsights_component_list - 列出 App Insights 资源
Log Analytics
  • azure__kusto,命令为 kusto_cluster_list - 列出群集
  • azure__kusto,命令为 kusto_query - 执行 KQL 查询

如果未启用 Azure MCP: 运行 /azure:setup 或通过 /mcp 启用。

CLI 参考

# List Log Analytics workspaces
az monitor log-analytics workspace list --output table

# Query logs with KQL
az monitor log-analytics query \
  --workspace WORKSPACE_ID \
  --analytics-query "AzureActivity | take 10"

# List Application Insights
az monitor app-insights component list --output table

# List alerts
az monitor alert list --output table

# Query metrics
az monitor metrics list \
  --resource RESOURCE_ID \
  --metric "Percentage CPU"

常用 KQL 查询

// Recent errors
AppExceptions
| where TimeGenerated > ago(1h)
| project TimeGenerated, Message, StackTrace
| order by TimeGenerated desc

// Request performance
AppRequests
| where TimeGenerated > ago(1h)
| summarize avg(DurationMs), count() by Name
| order by avg_DurationMs desc

// Resource usage
AzureMetrics
| where TimeGenerated > ago(1h)
| where MetricName == "Percentage CPU"
| summarize avg(Average) by Resource

监控策略

监控对象服务指标/日志
应用程序错误App Insights异常、失败请求
性能App Insights响应时间、依赖项
基础设施Azure MonitorCPU、内存、磁盘
安全性Log Analytics登录、审核日志
成本Cost Management预算警报

SDK 快速参考

如需以编程方式访问监控服务,请参阅精简版 SDK 指南:

服务详情

如需特定服务的详细文档:

评论

支持 Markdown