Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement comprehensive observability for Gamma integrations. Use when setting up monitoring, logging, tracing, or building dashboards for Gamma API usage. Trigger with phrases like "gamma monitoring", "gamma logging", "gamma metrics", "gamma observability", "gamma dashboard".
.claude/skills/jeremylongshore-gamma-observability/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 45% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 76% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 156% | 0% |
Implement monitoring, logging, and health checks for Gamma API integrations. Since Gamma does not expose rate limit headers or internal metrics, observability is built around your API call patterns, latency, error rates, credit consumption, and generation success rates.
gamma-sdk-patterns)typescript// src/observability/gamma-metrics.ts interface GammaMetrics { requests: number; errors: number; generations: number; completions: number; failures: number; totalCredits: number; totalLatencyMs: number; errorsByStatus: Record<number, number>; } const metrics: GammaMetrics = { requests: 0, errors: 0, generations: 0, completions: 0, failures: 0, totalCredits: 0, totalLatencyMs: 0, errorsByStatus: {}, }; export function createInstrumentedClient(apiKey: string) { const base = "https://public-api.gamma.app/v1.0"; const headers = { "X-API-KEY": apiKey, "Content-Type": "application/json" }; async function instrumentedRequest(method: string, path: string, body?: unknown) { metrics.requests++; const start = Date.now(); try { const res = await fetch(`${base}${path}`, { method, headers, body: body ? JSON.stringify(body) : undefined, }); metrics.totalLatencyMs += Date.now() - start; if (!res.ok) { metrics.errors++; metrics.errorsByStatus[res.status] = (metrics.errorsByStatus[res.status] || 0) + 1; throw new Error(`Gamma ${res.status}: ${await res.text()}`); } return res.json(); } catch (err) { if (!metrics.errorsByStatus[0]) metrics.errorsByStatus[0] = 0; metrics.totalLatencyMs += Date.now() - start; throw err; } } return { generate: async (body: any) => { metrics.generations++; return instrumentedRequest("POST", "/generations", body); }, poll: (id: string) => instrumentedRequest("GET", `/generations/${id}`), listThemes: () => instrumentedRequest("GET", "/themes"), listFolders: () => instrumentedRequest("GET", "/folders"), // Record completion metrics recordCompletion: (creditsUsed: number) => { metrics.completions++; metrics.totalCredits += creditsUsed; }, recordFailure: () => { metrics.failures++; }, }; } export function getMetrics() { return { ...metrics, avgLatencyMs: metrics.requests > 0 ? Math.round(metrics.totalLatencyMs / metrics.requests) : 0, errorRate: metrics.requests > 0 ? (metrics.errors / metrics.requests * 100).toFixed(2) + "%" : "0%", completionRate: metrics.generations > 0 ? (metrics.completions / metrics.generations * 100).toFixed(1) + "%" : "N/A", avgCreditsPerGeneration: metrics.completions > 0 ? Math.round(metrics.totalCredits / metrics.completions) : 0, }; }
typescript// src/observability/logger.ts function logGammaEvent(event: string, data: Record<string, any>) { console.log(JSON.stringify({ timestamp: new Date().toISOString(), service: "gamma", event, ...data, // Never log: apiKey, raw content (may contain PII) })); } // Usage logGammaEvent("generation.started", { generationId: "gen_abc123", outputFormat: "presentation", contentLength: 500, }); logGammaEvent("generation.completed", { generationId: "gen_abc123", creditsUsed: 42, latencyMs: 15000, }); logGammaEvent("generation.failed", { generationId: "gen_abc123", error: "Generation failed after 180s", });
typescript// src/api/health.ts async function checkGammaHealth() { const start = Date.now(); try { const res = await fetch("https://public-api.gamma.app/v1.0/themes", { headers: { "X-API-KEY": process.env.GAMMA_API_KEY! }, }); const latencyMs = Date.now() - start; if (!res.ok) { return { status: "unhealthy", latencyMs, error: `HTTP ${res.status}` }; } if (latencyMs > 5000) { return { status: "degraded", latencyMs, message: "High latency" }; } return { status: "healthy", latencyMs }; } catch (err: any) { return { status: "unhealthy", latencyMs: Date.now() - start, error: err.message }; } } app.get("/health/gamma", async (req, res) => { const health = await checkGammaHealth(); res.status(health.status === "unhealthy" ? 503 : 200).json(health); });
typescript// src/api/metrics.ts app.get("/metrics/gamma", (req, res) => { const m = getMetrics(); res.type("text/plain").send(` # HELP gamma_requests_total Total API requests # TYPE gamma_requests_total counter gamma_requests_total ${m.requests} # HELP gamma_errors_total Total API errors # TYPE gamma_errors_total counter gamma_errors_total ${m.errors} # HELP gamma_generations_total Total generations started # TYPE gamma_generations_total counter gamma_generations_total ${m.generations} # HELP gamma_completions_total Successful generations # TYPE gamma_completions_total counter gamma_completions_total ${m.completions} # HELP gamma_credits_total Total credits consumed # TYPE gamma_credits_total counter gamma_credits_total ${m.totalCredits} # HELP gamma_avg_latency_ms Average request latency # TYPE gamma_avg_latency_ms gauge gamma_avg_latency_ms ${m.avgLatencyMs} `.trim()); });
yaml# alerting-rules.yml (Prometheus) groups: - name: gamma rules: - alert: GammaHighErrorRate expr: rate(gamma_errors_total[5m]) / rate(gamma_requests_total[5m]) > 0.1 for: 5m annotations: summary: "Gamma error rate above 10%" - alert: GammaHealthUnhealthy expr: up{job="gamma-health"} == 0 for: 2m annotations: summary: "Gamma health check failing" - alert: GammaHighCreditBurn expr: rate(gamma_credits_total[1h]) > 100 for: 30m annotations: summary: "Gamma credit consumption > 100/hour" - alert: GammaLowCompletionRate expr: gamma_completions_total / gamma_generations_total < 0.8 for: 15m annotations: summary: "Gamma generation completion rate below 80%"
| Metric | Healthy | Warning | Critical | |--------|---------|---------|----------| | API error rate | < 5% | 5-10% | > 10% | | Health check latency | < 2s | 2-5s | > 5s | | Generation completion rate | > 90% | 80-90% | < 80% | | Credits per hour | Within budget | 75% of budget | Over budget | | Average generation time | < 30s | 30-60s | > 60s |
| Issue | Cause | Solution | |-------|-------|----------| | Metrics not appearing | Scrape config wrong | Check Prometheus targets | | Health check flapping | Network jitter | Add for: 2m to alert rules | | Credit alerts too noisy | Thresholds too low | Calibrate to your usage pattern | | Missing generation metrics | Not calling recordCompletion() | Ensure poll results feed metrics |
Proceed to gamma-incident-runbook for incident response.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 27,514 | 21,441 | -22% | 1 | 1 | 0% | 4,923 | 6,016 | +22% | 0 | 0 | — |
case-02 | fail→fail | 26,706 | 24,770 | -7% | 1 | 1 | 0% | 4,884 | 6,827 | +40% | 0 | 0 | — |
case-03 | fail→fail | 22,740 | 14,426 | -37% | 1 | 1 | 0% | 3,690 | 5,313 | +44% | 0 | 0 | — |
case-04 | pass→pass | 14,354 | 17,734 | +24% | 1 | 1 | 0% | 2,453 | 4,814 | +96% | 0 | 0 | — |
case-05 | pass→pass | 21,042 | 16,805 | -20% | 1 | 1 | 0% | 2,673 | 4,226 | +58% | 0 | 0 | — |
case-06 | pass→pass | 20,415 | 29,101 | +43% | 1 | 1 | 0% | 2,858 | 4,805 | +68% | 0 | 0 | — |
case-07 | fail→pass | 14,111 | 12,022 | -15% | 1 | 1 | 0% | 2,472 | 3,587 | +45% | 0 | 0 | — |
case-08 | pass→pass | 8,618 | 3,979 | -54% | 1 | 1 | 0% | 1,592 | 2,917 | +83% | 0 | 0 | — |
case-09 | fail→pass | 9,793 | 8,678 | -11% | 1 | 1 | 0% | 1,539 | 2,701 | +76% | 0 | 0 | — |
case-10 | fail→pass | 15,296 | 7,529 | -51% | 1 | 1 | 0% | 1,796 | 2,670 | +49% | 0 | 0 | — |
case-11 | fail→fail | 17,709 | 11,046 | -38% | 1 | 1 | 0% | 2,471 | 3,460 | +40% | 0 | 0 | — |
case-12 | fail→fail | 9,027 | 9,965 | +10% | 1 | 1 | 0% | 1,767 | 3,270 | +85% | 0 | 0 | — |
case-13 | pass→pass | 22,824 | 16,999 | -26% | 1 | 1 | 0% | 3,369 | 4,193 | +24% | 0 | 0 | — |
case-14 | pass→pass | 12,408 | 3,722 | -70% | 1 | 1 | 0% | 1,378 | 3,005 | +118% | 0 | 0 | — |
case-15 | fail→pass | 11,438 | 8,112 | -29% | 1 | 1 | 0% | 2,355 | 2,944 | +25% | 0 | 0 | — |
case-16 | fail→pass | 10,084 | 8,611 | -15% | 1 | 1 | 0% | 1,180 | 3,022 | +156% | 0 | 0 | — |
case-17 | fail→pass | 9,869 | 7,142 | -28% | 1 | 1 | 0% | 1,055 | 2,715 | +157% | 0 | 0 | — |
case-18 | fail→pass | 16,006 | 11,473 | -28% | 1 | 1 | 0% | 2,280 | 3,727 | +63% | 0 | 0 | — |
case-19 | pass→pass | 13,289 | 2,753 | -79% | 1 | 1 | 0% | 1,547 | 2,834 | +83% | 0 | 0 | — |
case-20 | fail→pass | 8,523 | 1,454 | -83% | 1 | 1 | 0% | 680 | 2,492 | +266% | 0 | 0 | — |
case-21 | fail→pass | 10,065 | 7,501 | -25% | 1 | 1 | 0% | 2,112 | 2,794 | +32% | 0 | 0 | — |
case-22 | pass→pass | 12,145 | 2,469 | -80% | 1 | 1 | 0% | 1,595 | 2,778 | +74% | 0 | 0 | — |
case-23 | fail→pass | 10,622 | 6,725 | -37% | 1 | 1 | 0% | 1,255 | 2,529 | +102% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +43 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.