From grafana-app-sdk
Configures Grafana Cloud testing with Synthetic Monitoring for multi-region HTTP/DNS/TCP/ping probes, k6 Cloud distributed load tests, and Faro real user monitoring. Use for uptime checks, API testing, and frontend performance.
npx claudepluginhub grafana/skills --plugin grafana-app-sdkThis skill uses the workspace's default tool permissions.
> **Docs**: https://grafana.com/docs/grafana-cloud/testing/
Configures synthetic monitoring for uptime checks, transaction flows, and API health using Pingdom, Datadog, or New Relic. Useful for tracking app availability and performance.
Manages Grafana Cloud Synthetic Monitoring checks: create, update, pull, push, delete using gcx CLI. Handles HTTP, Ping, DNS, TCP, Traceroute for URLs, hosts, domains with dry-run validation.
Configures Blackbox Exporter and Prometheus for uptime monitoring of HTTP/HTTPS endpoints, SSL certificates, multi-region probes, and status pages. Use for customer-facing APIs, websites, SLAs.
Share bugs, ideas, or general feedback.
Monitor uptime and performance from 20+ global locations without deploying your own agents.
| Check | Use Case |
|---|---|
| HTTP | Website and API availability, response validation |
| DNS | DNS resolution time and record validation |
| TCP | Port/service connectivity |
| Ping | ICMP availability |
| Traceroute | Network path diagnostics |
| Multihttp | Multi-step HTTP flows |
| Scripted (k6 browser) | Full browser-based user flow testing |
curl -X POST https://synthetic-monitoring-api.grafana.net/sm/checks \
-H "Authorization: Bearer <sm-access-token>" \
-H "Content-Type: application/json" \
-d '{
"job": "website",
"target": "https://example.com",
"frequency": 60000,
"timeout": 15000,
"enabled": true,
"probes": [1, 5, 10],
"settings": {
"http": {
"method": "GET",
"ipVersion": "V4",
"noFollowRedirects": false,
"tlsConfig": {},
"validStatusCodes": [200, 201],
"validHTTPVersions": ["HTTP/1.1", "HTTP/2.0"],
"failIfBodyMatchesRegexp": ["error", "exception"],
"failIfBodyNotMatchesRegexp": ["OK"],
"headers": [{"name": "User-Agent", "value": "Grafana-Synthetic-Monitoring"}]
}
}
}'
# Probe success rate
sum(rate(probe_success[5m])) by (job, instance, probe)
# HTTP response time p95
histogram_quantile(0.95, sum(rate(probe_duration_seconds_bucket[5m])) by (le, job))
# DNS lookup time
avg(probe_dns_lookup_time_seconds) by (job, instance)
# TLS expiry days remaining
(probe_ssl_earliest_cert_expiry - time()) / 86400
groups:
- name: synthetic-monitoring
rules:
- alert: SyntheticCheckFailing
expr: avg_over_time(probe_success[5m]) < 0.9
for: 5m
labels:
severity: critical
annotations:
summary: "{{ $labels.job }} failing from {{ $labels.probe }}"
- alert: TLSCertExpiringSoon
expr: (probe_ssl_earliest_cert_expiry - time()) / 86400 < 14
labels:
severity: warning
annotations:
summary: "TLS cert for {{ $labels.instance }} expires in {{ $value }} days"
Run distributed load tests from multiple AWS regions without managing infrastructure.
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
cloud: {
projectID: 3456789,
name: 'API Load Test - Release v2.0',
distribution: {
loadZone1: { loadZone: 'amazon:us:ashburn', percent: 50 },
loadZone2: { loadZone: 'amazon:eu:dublin', percent: 30 },
loadZone3: { loadZone: 'amazon:ap:tokyo', percent: 20 },
},
},
scenarios: {
load: {
executor: 'ramping-vus',
startVUs: 0,
stages: [
{ duration: '2m', target: 100 },
{ duration: '10m', target: 100 },
{ duration: '2m', target: 0 },
],
},
},
thresholds: {
http_req_duration: ['p(95)<500'],
http_req_failed: ['rate<0.01'],
},
};
export default function () {
const res = http.get('https://api.example.com/users');
check(res, {
'status 200': (r) => r.status === 200,
'fast': (r) => r.timings.duration < 500,
});
sleep(1);
}
# Authenticate
k6 cloud login --token <your-grafana-cloud-token>
# Run in cloud
k6 cloud script.js
# Run locally but stream to cloud
k6 run --out cloud script.js
# List test runs
curl https://api.k6.io/v3/projects/{projectId}/test-runs \
-H "Authorization: Token <token>"
# Get test run results
curl https://api.k6.io/v3/runs/{runId} \
-H "Authorization: Token <token>"
# Stop a running test
curl -X POST https://api.k6.io/v3/runs/{runId}/stop \
-H "Authorization: Token <token>"
# GitHub Actions
- name: Run k6 Load Test
uses: grafana/k6-action@v0.3.1
with:
filename: tests/load.js
cloud: true
token: ${{ secrets.K6_CLOUD_TOKEN }}
flags: --out cloud
// Initialize Faro in your web app
import { initializeFaro, getWebInstrumentations } from '@grafana/faro-web-sdk';
import { TracingInstrumentation } from '@grafana/faro-web-tracing';
const faro = initializeFaro({
url: 'https://faro-collector-prod-xx.grafana.net/collect',
apiKey: 'your-faro-api-key',
app: {
name: 'my-frontend',
version: '1.0.0',
environment: 'production',
},
instrumentations: [
...getWebInstrumentations({
captureConsole: true,
captureConsoleDisabledLevels: [],
}),
new TracingInstrumentation(),
],
});
// Custom events
faro.api.pushEvent('checkout_completed', { cart_value: '99.99' });
// Custom measurements
faro.api.pushMeasurement({ type: 'api_latency', values: { ms: 234 } });
// Error capturing
faro.api.pushError(new Error('Payment failed'));
# Install
npm install @grafana/faro-web-sdk @grafana/faro-web-tracing