send-data — скилл для Claude Code: что делает и как установить
Помогает настроить отправку метрик, логов, трейсов и профилей в Grafana Cloud. Пригодится при настройке Alloy, OTLP-экспортёров, Prometheus remote write и Helm-чартов.
npx skills add grafana/skills --skill send-data -a claude-codeЧто делает send-data
Скилл содержит готовые шаблоны конфигураций для пересылки телеметрии в Grafana Cloud. Он описывает пайплайны агента Alloy для метрик, логов и трейсов, а также прямую отправку через Prometheus remote write, Loki push API и OpenTelemetry SDK для Python.
Внутри есть схемы развёртывания Helm-чарта grafana/k8s-monitoring версии 4.1.4 для Kubernetes, примеры вызовов API интеграций и роли для сервисных токенов вроде MetricsPublisher или LogsPublisher.
Для работы понадобятся реквизиты инстанса из Grafana Cloud Portal: эндпоинты Prometheus, Loki или Tempo и действующий API-ключ. Без предварительного создания этих ключей в панели управления ни один из пайплайнов данные не примет.
Какие задачи решает
- настроить отправку метрик из Prometheus через remote write
- сконфигурировать Grafana Alloy для сбора логов, трейсов и метрик
- подключить OpenTelemetry SDK к OTLP-шлюзу Grafana Cloud
- развернуть сбор телеметрии в кластере Kubernetes через Helm
- создать API-ключи с нужными ролями для публикации телеметрии
Примеры запросов агенту
- Покажи конфиг Alloy для отправки логов из /var/log/app/*.log в Grafana Cloud Loki.
- Как настроить remote_write в prometheus.yml для Grafana Cloud с базовой авторизацией?
- Сгенерируй values.yaml для Helm-чарта grafana/k8s-monitoring с отправкой метрик и логов.
Как установить send-data
1Через Skills CLI (Vercel)
npx skills add grafana/skills --skill send-data -a claude-code2Вручную: положить файлы
~/.claude/skills/send-data/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/send-data/
1Через Skills CLI (Vercel)
npx skills add grafana/skills --skill send-data -a codex2Вручную: положить файлы
.agents/skills/send-data/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add grafana/skills --skill send-data -a cursor2Вручную: положить файлы
.cursor/skills/send-data/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install grafana/skills send-data2Вручную: положить файлы
.github/skills/send-data/SKILL.md1Через Skills CLI (Vercel)
npx skills add grafana/skills --skill send-data -a gemini-cli2Командой платформы
gemini skills install https://github.com/grafana/skills --path skills/grafana-cloud/send-dataВручную: положить файлы
.devin/skills/send-data/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add grafana/skills --skill send-data -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о send-data
Как установить send-data в Claude Code?
Выполните команду npx skills add grafana/skills --skill send-data -a claude-code. Конфигурация скилла будет сохранена в ~/.claude/skills/send-data/SKILL.md.
Что делает скилл send-data?
Скилл даёт языковой модели инструкции и примеры конфигураций для подключения сервисов к Grafana Cloud через Alloy, Prometheus remote write, OTLP или Helm.
Какие роли нужны для API-ключей при отправке данных?
В зависимости от передаваемого сигнала используются роли MetricsPublisher, LogsPublisher, TracesPublisher или ProfilesPublisher.
Исходный текст
SKILL.md · Apache-2.0
---
name: send-data
license: Apache-2.0
description: >
Sending telemetry data to Grafana Cloud — metrics via Prometheus remote write or OTLP, logs via
Loki push or Alloy, traces via OTLP to Tempo, profiles via Pyroscope. Covers Alloy-based pipelines,
direct SDK/agent integrations, cloud integrations catalog, and credentials management.
Use when connecting an application or infrastructure to Grafana Cloud, setting up data ingestion,
configuring remote write, or choosing between ingestion methods.
---
# Sending Data to Grafana Cloud
> **Docs**: https://grafana.com/docs/grafana-cloud/send-data/
## Quick Start: Find Your Credentials
In Grafana Cloud portal → **My Account** → **Stack** → **Details**:
| Signal | Credential Fields |
|--------|------------------|
| Metrics | Prometheus remote write URL, username, password/API key |
| Logs | Loki URL, username, password/API key |
| Traces | Tempo OTLP endpoint, username, password/API key |
| Profiles | Pyroscope URL, username, password/API key |
## Alloy (Recommended — All Signals)
```alloy
// METRICS
prometheus.scrape "app" {
targets = [{"__address__" = "localhost:8080"}]
forward_to = [prometheus.remote_write.cloud.receiver]
}
prometheus.remote_write "cloud" {
endpoint {
url = "https://prometheus-prod-xx.grafana.net/api/prom/push"
basic_auth {
username = sys.env("PROM_USER")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
}
}
// LOGS
loki.source.file "app" {
targets = [{__path__ = "/var/log/app/*.log", job = "app"}]
forward_to = [loki.write.cloud.receiver]
}
loki.write "cloud" {
endpoint {
url = "https://logs-prod-xx.grafana.net/loki/api/v1/push"
basic_auth {
username = sys.env("LOKI_USER")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
}
}
// TRACES (OTLP receive → forward)
otelcol.receiver.otlp "default" {
grpc { endpoint = "0.0.0.0:4317" }
http { endpoint = "0.0.0.0:4318" }
output {
traces = [otelcol.exporter.otlp.cloud.input]
}
}
otelcol.exporter.otlp "cloud" {
client {
endpoint = "tempo-prod-xx.grafana.net:443"
auth = otelcol.auth.basic.cloud.handler
}
}
otelcol.auth.basic "cloud" {
username = sys.env("TEMPO_USER")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
```
## Direct Prometheus Remote Write
```yaml
# prometheus.yml
remote_write:
- url: https://prometheus-prod-xx.grafana.net/api/prom/push
basic_auth:
username: "123456"
password: "your-api-key"
write_relabel_configs:
- source_labels: [__name__]
regex: "go_.*"
action: drop # optional: drop high-cardinality metrics
```
## Direct Loki Push (curl)
```bash
curl -X POST https://logs-prod-xx.grafana.net/loki/api/v1/push \
-H "Content-Type: application/json" \
-u "123456:your-api-key" \
-d '{
"streams": [{
"stream": { "app": "myapp", "env": "prod" },
"values": [
["1706745600000000000", "application started"]
]
}]
}'
```
## OpenTelemetry SDK → Grafana Cloud
```bash
# Environment variables for OTLP export
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otlp-gateway-prod-xx.grafana.net/otlp"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic $(echo -n '123456:your-api-key' | base64)"
export OTEL_SERVICE_NAME="my-service"
```
Python example:
```python
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
provider = TracerProvider()
exporter = OTLPSpanExporter() # reads OTEL_EXPORTER_OTLP_* env vars
provider.add_span_processor(BatchSpanProcessor(exporter))
trace.set_tracer_provider(provider)
```
## Cloud Integrations
Pre-built integrations for common infrastructure (install from Grafana Cloud UI or API):
```bash
# List available integrations
curl https://integrations-api-prod.grafana.net/api/v1/integrations \
-H "Authorization: Bearer <api-key>"
# Install AWS CloudWatch integration
curl -X POST https://integrations-api-prod.grafana.net/api/v1/integrations/cloudwatch \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{"name": "aws-prod", "config": {...}}'
```
Popular integrations: AWS CloudWatch, Azure Monitor, GCP, Kubernetes, Docker, MySQL, PostgreSQL, Redis, Nginx, Apache, JVM, Node.js, Python, .NET.
## Kubernetes Agent Operator
```yaml
# values.yaml for grafana/k8s-monitoring Helm chart
cluster:
name: production
externalServices:
prometheus:
host: https://prometheus-prod-xx.grafana.net
basicAuth:
username: "123456"
password:
secretName: grafana-cloud-secret
secretKey: api-key
loki:
host: https://logs-prod-xx.grafana.net
basicAuth:
username: "234567"
password:
secretName: grafana-cloud-secret
secretKey: api-key
metrics:
enabled: true
podMonitors:
enabled: true
serviceMonitors:
enabled: true
logs:
pod_logs:
enabled: true
traces:
enabled: true
```
```bash
helm install k8s-monitoring grafana/k8s-monitoring \
--version 4.1.4 \
-n monitoring --create-namespace \
-f values.yaml
```
## API Key Management
```bash
# Create API key via Grafana API
curl -X POST https://yourstack.grafana.net/api/auth/keys \
-H "Content-Type: application/json" \
-u "admin:adminpassword" \
-d '{"name": "alloy-writer", "role": "MetricsPublisher", "secondsToLive": 0}'
```
Roles for data ingestion: `MetricsPublisher`, `LogsPublisher`, `TracesPublisher`, `ProfilesPublisher`
© grafana · Apache-2.0 · grafana/skills