选项
首页首页 Skill 云基础设施 cloud-integrations

cloud-integrations

grafana/skills grafana/skills

用于为 AWS、Azure 及其他云服务提供商设置、配置 Grafana Cloud 集成并排除相关故障。当用户请求连接 AWS CloudWatch、设置 Azure Monitor、配置 Confluent Cloud 可观测性功能、安装 Grafana 集成组件、设置托管导出器、使用 AWS Firehose 处理 CloudWatch 日志,或需要排除云集成故障时即可使用该功能。会在出现“AWS CloudWatch”、“Azure Monitor”、“Confluent integration”、“cloud integration”、“hosted exporter”、“AWS Firehose”、“install”等短语时触发。

...展开全部
12
更新时间 2026-08-25

关于云集成功能

cloud-integrations 功能可帮助用户为各类云服务提供商设置、配置 Grafana Cloud 集成,并解决相关故障问题。它无需用户自行搭建数据导出工具,即可将云服务提供商的监控 API 与 Grafana 系统相连。该功能通过托管型数据导出工具解决数据获取问题——这类工具会代表用户抓取提供商的 API 数据并推送至 Grafana 系统,也可通过流式传输方式实现更低延迟的数据传输。

相关技能文档涵盖了多种支持的托管型数据导出工具,包括 AWS CloudWatch(通过 YACE 接口支持所有命名空间)、Azure Monitor(通过 Azure Monitor API)、Confluent Cloud(通过 Confluent Metrics API 支持 Kafka 监控数据),以及通用的 Prometheus 格式 HTTP 接口;同时还介绍了通过 Kinesis Firehose 实现近乎实时数据传输的 AWS Firehose 接收器。文档提供了分步设置指南:指导用户如何在 Grafana Cloud 中管理连接、确定所需的最低 AWS IAM 权限集(包括 GetMetricData、GetMetricStatistics、ListMetrics、tag:GetResources 以及 EC2 describe 权限)、讲解如何使用 Terraform 选择轮询模式或 Firehose 流式传输模式来处理指标流和数据传输流、说明如何为 Azure 创建带有 Monitoring Reader 角色的服务主体,以及如何为 Confluent 创建带有 MetricsViewer 角色的指标 API 密钥。此外,文档还介绍了验证方法——包括在 Explore 页面查询集成任务标签、通过 Prometheus 接口检查标签到达情况,以及查看集成健康指标(最近一次成功抓取时间、数据系列数量、错误率)——并提供了预构建的仪表板和警报功能。所有凭证(AWS 访问密钥、Azure 客户端密钥、Confluent 密钥、API 令牌)均以标准设置指南的形式呈现,其中包含占位符,且所有权限设置均遵循最小权限原则。

该文档主要面向需要将云监控数据接入 Grafana Cloud 的平台工程师、SRE 以及可观测性团队。其应用场景包括连接 AWS CloudWatch、配置 Azure Monitor、设置 Confluent Cloud 的监控功能、在轮询模式与 Firehose 流式传输模式之间做选择,以及排查集成故障。

常见问题

支持哪些云服务提供商和数据源?

支持 AWS CloudWatch(通过 YACE 接口)、Azure Monitor、Confluent Cloud 以及任何通用的 Prometheus 格式 HTTP 接口,同时还支持通过 Kinesis Firehose 实现近乎实时数据传输的 AWS Firehose 接收器。

需要哪些 AWS 权限?

至少需要包含 cloudwatch:GetMetricData、GetMetricStatistics、ListMetrics、tag:GetResources,以及 ec2:DescribeInstances 和 DescribeRegions 权限的 IAM 策略,该策略需绑定到 IAM 用户或跨账户角色上。

托管型数据导出工具与 Firehose 接收器有何区别?

托管型数据导出工具大约每 60 秒轮询一次 CloudWatch API,数据延迟约为 1–5 分钟;而 Firehose 接收器则通过 Kinesis Firehose 对 CloudWatch Metric Streams 和日志订阅数据进行流式传输,可实现近乎实时的低延迟数据交付。

如何验证集成是否正常工作?

可在 Grafana 的 Explore 页面查询该集成的任务标签(例如 integrations/cloudwatch),通过系统的 Prometheus 标签接口检查标签是否已到达,同时可在 Connections > [Integration] > Status 页面查看健康指标——包括最近一次成功抓取时间应在 2 分钟内、非零的稳定数据系列数量,以及 0% 的错误率。

需要哪些 Azure 和 Confluent 凭证?

对于 Azure,需要为目标订阅账户创建带有 Monitoring Reader 角色的服务主体(包括租户信息、客户端 ID 和客户端密钥)。对于 Confluent,则需要带有 MetricsViewer 角色的指标 API 密钥(而非 Kafka 密钥)。

在 GitHub 上查看

Grafana Cloud Integrations connect cloud provider monitoring APIs to your Grafana stack withoutrunning your own exporters. Hosted exporters scrape cloud APIs on your behalf and push metricsto your Grafana Cloud stack.

Supported hosted exporters:

  • AWS CloudWatch - all CloudWatch namespaces via YACE (Yet Another CloudWatch Exporter)
  • Azure Monitor - Azure resource metrics via the Azure Monitor API
  • Confluent Cloud - Kafka cluster metrics via the Confluent Metrics API
  • Generic HTTP endpoint - any Prometheus-format /metrics endpoint behind auth

AWS Firehose receiver - ingests CloudWatch Logs and Metrics Streams pushed via KinesisFirehose (near real-time, lower latency than API scraping).

Step 1: Navigate to Connections

In Grafana Cloud: Connections > Add new connection (or Connections > Cloud Provider).

Available paths:

  • AWS CloudWatch - hosted exporter + optional Firehose receiver
  • Azure Monitor - hosted exporter
  • Confluent Cloud - hosted exporter
  • All integrations - full catalog including Linux, MySQL, Kubernetes, etc.

Step 2: AWS CloudWatch integration

Option A: Hosted exporter (polling)

The hosted exporter scrapes CloudWatch API every 60s. Latency: ~1-5 minutes.

Required IAM permissions (minimum):

{  "Version": "2012-10-17",  "Statement": [    {      "Effect": "Allow",      "Action": [        "cloudwatch:GetMetricData",        "cloudwatch:GetMetricStatistics",        "cloudwatch:ListMetrics",        "tag:GetResources",        "ec2:DescribeInstances",        "ec2:DescribeRegions"      ],      "Resource": "*"    }  ]}

Setup steps:

  1. Create an IAM user or role with the policy above
  2. Generate an access key pair (for IAM user) or configure cross-account role assumption
  3. In Grafana Cloud: Connections > AWS > Configure hosted exporter
  4. Enter: AWS Access Key ID, Secret Access Key, region(s), CloudWatch namespaces to scrape
  5. Grafana provisions the exporter and begins scraping within 2-3 minutes

Supported namespaces: EC2, RDS, ELB/ALB, S3, Lambda, ECS, SQS, SNS, ElastiCache,Kinesis, DynamoDB, and 50+ others.

Option B: AWS Firehose receiver (streaming)

Near-real-time metrics and logs via CloudWatch Metric Streams and CloudWatch Logs subscriptions.

Architecture:

CloudWatch Metric Streams → Kinesis Firehose → Grafana Cloud Firehose ReceiverCloudWatch Logs (subscription filter) → Kinesis Firehose → Grafana Cloud Firehose Receiver

Setup:

  1. In Grafana Cloud: Connections > AWS > Firehose receiver
  2. Grafana provides an HTTPS endpoint URL and access token
  3. In AWS, create a Kinesis Firehose delivery stream:
    • Destination: HTTP endpoint
    • Endpoint URL: (from step 2)
    • Access key: (from step 2)
    • Content encoding: GZIP
  4. Create a CloudWatch Metric Stream pointing at the Firehose stream:
    • Output format: OpenTelemetry 1.0
    • Namespaces: select or include all
  5. For logs: add a CloudWatch Logs subscription filter pointing at the Firehose stream

Terraform for Firehose setup:

resource "aws_cloudwatch_metric_stream" "grafana_cloud" {  name          = "grafana-cloud-metrics"  role_arn      = aws_iam_role.firehose_role.arn  firehose_arn  = aws_kinesis_firehose_delivery_stream.grafana.arn  output_format = "opentelemetry1.0"  # Optionally scope to specific namespaces  # include_filter { namespace = "AWS/EC2" }  # include_filter { namespace = "AWS/RDS" }}resource "aws_kinesis_firehose_delivery_stream" "grafana" {  name        = "grafana-cloud-stream"  destination = "http_endpoint"  http_endpoint_configuration {    url            = var.grafana_firehose_endpoint    access_key     = var.grafana_firehose_access_key    name           = "Grafana Cloud"    content_encoding = "GZIP"    s3_configuration {      role_arn   = aws_iam_role.firehose_role.arn      bucket_arn = aws_s3_bucket.firehose_backup.arn    }  }}

Step 3: Azure Monitor integration

Required Azure permissions:

Create a service principal with the Monitoring Reader role on the subscription(s) to monitor.

# Create service principalaz ad sp create-for-rbac --name grafana-cloud-monitoring \  --role "Monitoring Reader" \  --scopes /subscriptions/<SUBSCRIPTION_ID># Output: appId (client ID), password (client secret), tenant

Setup in Grafana Cloud:

  1. Connections > Azure > Configure hosted exporter
  2. Enter: Tenant ID, Client ID, Client Secret, Subscription IDs
  3. Select resource types to monitor (VMs, App Services, AKS, SQL, etc.)
  4. The exporter begins scraping within 2-3 minutes

Supported resource types: Virtual Machines, App Service Plans, AKS, Azure SQL, CosmosDB,Storage Accounts, Event Hubs, Service Bus, Application Gateway, and others.

Step 4: Confluent Cloud integration

Required Confluent API credentials:

  1. In Confluent Cloud: Environment > API Keys (or Cloud API Keys for organization-level)
  2. Create a Metrics API key (not a Kafka API key) with MetricsViewer role
  3. Note the API Key and Secret

Setup in Grafana Cloud:

  1. Connections > Confluent > Configure hosted exporter
  2. Enter: Confluent API Key, API Secret, Environment ID(s), Cluster ID(s)
  3. The exporter scrapes the Confluent Metrics API every 60s

Available metrics: Consumer lag, broker request rates, partition counts, replication lag,active controller count, and cluster-level health metrics.

Step 5: Verify the integration is working

# Check in Grafana Explore — query for the integration's job label# For AWS:{job="integrations/cloudwatch"}# For Azure:{job="integrations/azure-monitor"}# Check metric arrival (replace with your stack's Prometheus endpoint)curl -s -H "Authorization: Bearer <USER>:<API_KEY>" \  "https://prometheus-prod-XX-XX-X.grafana.net/api/prom/api/v1/labels" | \  jq '.data | map(select(startswith("aws_") or startswith("azure_")))'

The integration status is also visible in: Connections > [Integration name] > Status

Integration health indicators:

  • Last successful scrape - should be within the last 2 minutes
  • Series count - should be non-zero and stable
  • Error rate - should be 0%

Step 6: Pre-built dashboards and alerts

Every integration installs a set of pre-configured dashboards and alert rules automatically.

Find installed dashboards:

  • Dashboards > Browse > folder named after the integration (e.g. "AWS CloudWatch")

Find installed alert rules:

  • Alerting > Alert rules > filter by datasource or folder

Modify without losing updates:

  1. Do not edit the provisioned dashboards directly (they may be overwritten on updates)
  2. Duplicate the dashboard (Dashboard settings > Save as copy)
  3. Edit the copy

Step 7: Troubleshoot integration failures

Hosted exporter not receiving data:

# Check the integration status via Grafana Cloud APIcurl -s -H "Authorization: Bearer <STACK_ID>:<API_TOKEN>" \  "https://integrations-api.grafana.net/api/v1/integrations" | \  jq '.integrations[] | {name, status, lastScrapeTime, errorMessage}'

Common errors:

ErrorCauseFix
AccessDenied (AWS)IAM policy missing permissionsAdd required actions to the IAM policy
AuthorizationFailed (Azure)Service principal missing roleGrant Monitoring Reader on the subscription
401 Unauthorized (Confluent)Wrong API credentialsRe-enter credentials; confirm Metrics API key (not Kafka key)
No metrics foundWrong namespace/resource type selectedAdd the namespace in integration settings
Scrape timeoutNetwork restrictionEnsure Grafana Cloud's IPs can reach the cloud provider API

AWS-specific: CloudWatch API rate limiting

CloudWatch GetMetricData has a rate limit. If you have many resources, enable Metric Streams(Option B) instead of API polling to avoid throttling.

Step 8: Reduce costs with metric filtering

Hosted exporters scrape all metrics by default. Filter to reduce series count and cost.

AWS - select specific namespaces:In integration settings, switch from "All namespaces" to specific ones (e.g. EC2, RDS only).

AWS - filter by resource tags:

# In exporter configuration, add tag filtersdiscovery:  - type: AWS/EC2    filters:      - key: Environment        values: ["production"]

Azure - select specific resource types:Only enable the resource types you actually have dashboards for.

Use Adaptive Metrics to aggregate away unused label dimensions:See the grafana-cloud/adaptive-metrics skill.

References

  • Grafana Cloud Connections documentation
  • AWS CloudWatch integration
  • Azure Monitor integration
  • YACE (Yet Another CloudWatch Exporter)
  • CloudWatch Metric Streams

所有文件

0 个文件

安装 cloud-integrations

将技能文件下载并解压到您的 .claude/skills/ 目录中。

下载ZIP

克隆仓库并复制技能文件到您的项目中。

git clone https://github.com/grafana/skills/blob/main/skills/grafana-cloud/cloud-integrations/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

复制 复制
快速设置: 将该技能文件夹复制到 .claude/skills/ 目录中,Claude 会自动检测并使用该技能。

相关技能

Cloudflare Manager
更新时间 2026-06-29
pinecone
更新时间 2026-06-29
sentry-architecture-variants
更新时间 2026-06-29
azure-setup-guide
更新时间 2026-06-29
OR