Automated summary
This skill instruments Groq API integrations with Prometheus metrics (latency, token throughput, rate limits, cost) and alerting rules.
Strengths
- Targets Groq-specific signals: TTFT, tokens/second, and x-ratelimit-remaining headers
- Gives a concrete instrumentation loop (wrapped client plus metric emission) rather than generic advice
- Ships Prometheus alert rules and dashboard panels tuned to Groq's sub-200ms baseline
- Adds structured per-request JSON logging for log aggregation
Limitations
- Assumes a Node.js/TypeScript stack with groq-sdk and prom-client plus a Prometheus scrape target
- Full step-by-step code lives in references/implementation.md, which is not part of the SKILL.md body
- Does not cover server-side instrumentation or providers other than Groq
Use it when you need to instrument Groq calls with metrics, latency/cost/rate-limit alerts, or build a Groq monitoring dashboard.
Avoid it if your project does not use Groq or if you want a vendor-neutral observability setup.
Security analysis
SafeThe skill is documentation-only: a Prometheus/observability wiring guide for Groq API calls. Declared allowed-tools are Read/Write/Edit, with no Bash, Docker, or network execution surface. The included code wraps an API client to emit local metrics and logs; there is no curl|sh, no rm -rf, no credential or token exfiltration, no base64 payloads, and no attempt to disable safety controls. The only external dependency is the legitimate groq-sdk reading GROQ_API_KEY from the environment, which is standard and non-exfiltrating.
No concerns found
How this analysis is madeExamples
Wrap my Groq chat.completions.create calls so each request records latency, tokens per second, and estimated cost.Add Prometheus alert rules that fire before my Groq integration hits a 429, using the x-ratelimit-remaining headers.Build a Grafana dashboard for my Groq integration showing TTFT distribution, tokens/sec, error rate, and cost.name: groq-observability description: 'Set up observability for Groq integrations: latency histograms, token throughput,
rate limit gauges, cost tracking, and Prometheus alerts.
Use when instrumenting Groq API calls, building a metrics dashboard, or wiring latency/cost/rate-limit alerts.
Trigger with phrases like "groq monitoring", "groq metrics",
"groq observability", "monitor groq", "groq alerts", "groq dashboard".
' allowed-tools: Read, Write, Edit version: 1.11.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
- saas
- groq
- monitoring
- observability
- dashboard compatibility: Designed for Claude Code
Groq Observability
Overview
Monitor Groq LPU inference for latency, token throughput, rate limit utilization, and cost. Groq's defining advantage is speed (280-560 tok/s), so latency degradation is the highest-priority signal. The API returns rich timing metadata (queue_time, prompt_time, completion_time) and rate limit headers on every response.
Prerequisites
- A Groq account with an API key exported as the
GROQ_API_KEYenvironment variable — thegroq-sdkclient reads it automatically (new Groq()). - Node.js with
groq-sdkandprom-clientinstalled (npm install groq-sdk prom-client). - A Prometheus scrape target and (optionally) Grafana for the dashboard panels.
Key Metrics to Track
| Metric | Type | Source | Why |
|--------|------|--------|-----|
| TTFT (time to first token) | Histogram | Client-side timing | Groq's main value prop |
| Tokens/second | Gauge | usage.completion_time | Throughput degradation |
| Total latency | Histogram | Client-side timing | End-to-end performance |
| Rate limit remaining | Gauge | x-ratelimit-remaining-* headers | Prevent 429s |
| Token usage | Counter | usage.total_tokens | Cost attribution |
| Error rate by code | Counter | Error handler | Availability |
| Estimated cost | Counter | Tokens * model price | Budget tracking |
Instructions
Apply these six steps in order. Steps 1-2 are the core instrumentation loop — wrap the client, then feed a Prometheus instrument set from each call. Steps 3-6 add rate-limit tracking, alerting, structured logs, and dashboards on top. The lean client skeleton is below; the full code for every step lives in references/implementation.md.
- Instrumented client — wrap
groq.chat.completions.createso latency, tokens, queue time, and estimated cost are captured on the same path as the request (trackedCompletion). - Prometheus metrics — register a histogram (latency), counters (tokens, cost, errors), and gauges (throughput, rate-limit remaining), then feed them from
emitMetrics. - Rate limit header tracking — parse
x-ratelimit-remaining-*off every response into a gauge so you alert before a 429, not after. - Prometheus alert rules — ship latency/rate-limit/throughput/error/cost alerts tuned to Groq's sub-200ms, 280+ tok/s baseline.
- Structured request logging — emit one JSON line per request for log aggregation, preserving per-request detail metrics roll up.
- Dashboard panels — TTFT distribution, tokens/sec, rate-limit utilization, request volume, error rate, cost, and queue time.
import Groq from "groq-sdk";
const groq = new Groq(); // reads GROQ_API_KEY
async function trackedCompletion(model: string, messages: any[]) {
const start = performance.now();
const result = await groq.chat.completions.create({ model, messages });
const latencyMs = performance.now() - start;
const usage = result.usage!;
const metrics = {
model,
latencyMs: Math.round(latencyMs),
tokensPerSec: Math.round(usage.completion_tokens / ((usage as any).completion_time || latencyMs / 1000)),
totalTokens: usage.total_tokens,
};
emitMetrics(metrics); // -> Prometheus (Step 2)
return { result, metrics };
}
See references/implementation.md for the complete
GroqMetrics shape, pricing table, Prometheus instruments, rate-limit tracking,
alert rules, structured logging, and dashboard panel list.
Output
Applying the workflow produces:
- A
trackedCompletionwrapper that returns{ result, metrics }, wheremetricsis aGroqMetricsobject (latency, TTFT, tokens/sec, token counts, queue time, estimated cost). - A Prometheus metric set —
groq_latency_ms(histogram),groq_tokens_total/groq_cost_usd/groq_errors_total(counters), andgroq_tokens_per_second/groq_ratelimit_remaining(gauges). - Five alert rules (
GroqLatencyHigh,GroqRateLimitCritical,GroqThroughputDrop,GroqErrorRateHigh,GroqCostSpike). - A structured JSON log line per request and a 7-panel dashboard spec.
Examples
Instrument a single completion and emit a structured log line:
const { result, metrics } = await trackedCompletion(
"llama-3.3-70b-versatile",
[{ role: "user", content: "Summarize this incident report in two sentences." }]
);
logGroqRequest(metrics, result.id);
// metrics.tokensPerSec -> 310, metrics.estimatedCostUsd -> 0.000404
For a 429-guard using rate-limit headers and a dashboard health-reading table, see references/examples.md.
Error Handling
| Issue | Cause | Solution | |-------|-------|----------| | 429 with high retry-after | RPM or TPM exhausted | Implement request queuing | | Latency spike > 2s | Model overloaded or large prompt | Reduce prompt size or switch to lighter model | | 503 Service Unavailable | Groq capacity issue | Enable fallback to alternative provider | | Tokens/sec drop | Streaming disabled or large prompts | Enable streaming for better perceived performance |
Resources
- references/implementation.md — full code for all six observability steps.
- references/examples.md — worked instrumentation, 429-guard, and dashboard-reading examples.
- Groq API Reference (usage fields)
- Groq Rate Limits
- prom-client on npm
- For incident response procedures, see the
groq-incident-runbookskill.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/groq-observability-mte1lif2/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/groq-observability-mte1lif2' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/groq-observability-mte1lif2/download' --output '.skill-downloads/groq-observability-mte1lif2/SKILL.md.part' && mv '.skill-downloads/groq-observability-mte1lif2/SKILL.md.part' '.skill-downloads/groq-observability-mte1lif2/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Environment declared by the author: Designed for Claude Code
Tools declared by the author (check availability in your agent): Read, Write, Edit
Original excerpt: Prerequisites
- A Groq account with an API key exported as the
GROQ_API_KEYenvironment variable — thegroq-sdkclient reads it automatically (new Groq()). - Node.js with
groq-sdkandprom-clientinstalled (npm install groq-sdk prom-client). - A Prometheus scrape target and (optionally) Grafana for the dashboard panels.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/groq-observability-mte1lif2/SKILL.md' && test -s '.skill-downloads/groq-observability-mte1lif2/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/groq-observability' && cp -R '.skill-downloads/groq-observability-mte1lif2' '.claude/skills/groq-observability'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/groq-observability-mte1lif2'openskills read 'groq-observability-mte1lif2'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/groq-observability-mte1lif2/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.