StatsD metric instrumentation: push metrics over UDP, choose the right metric type, name consistently. Invoke whenever task involves any interaction with StatsD metrics — emitting counters, gauges, timers, histograms, sets, or distributions; configuring DogStatsD tags; tuning sampling rates; or integrating with Graphite, Prometheus, or Telegraf backends.
Generates StatsD metrics with correct types, naming conventions, and tag configurations for monitoring backends.
npx claudepluginhub xobotyi/cc-foundryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/aggregation.mdreferences/backends.mdreferences/client-patterns.mdreferences/dogstatsd.mdreferences/metric-types.mdreferences/naming.mdChoose the right metric type, name it with dot-delimited hierarchy, tag dimensions instead of encoding them in names. StatsD is fire-and-forget: UDP means zero latency impact on your application, but wrong metric types or bad naming corrupt your data silently.
| Topic | Reference | Contents |
|---|---|---|
| Metric types | references/metric-types.md | Wire format details, type comparison, sampling correction |
| Naming | references/naming.md | Graphite namespace mapping, character rules, naming examples |
| DogStatsD | references/dogstatsd.md | Events format, service checks, protocol versions, distributions vs histograms |
| Aggregation | references/aggregation.md | Flush mechanics, Graphite downsampling, DogStatsD aggregation, timestamps |
| Client patterns | references/client-patterns.md | High-throughput tuning, error handling, K8s deployment, UDS configuration |
| Backends | references/backends.md | statsd_exporter config, Telegraf setup, migration guides |
Wire format: <metric_name>:<value>|<type>[|@<sample_rate>][|#<tags>]
| Question | Type |
|---|---|
| How many times did X happen? | Counter (c) |
| What is X right now? | Gauge (g) |
| How long did X take? | Timer (ms) |
| What is the distribution of X? | Histogram (h) |
| How many unique X occurred? | Set (s) |
| What is the global distribution of X? | Distribution (d, DogStatsD only) |
Wrong metric type = wrong math at the server. A gauge used as a counter loses data between flushes. A counter used as a gauge produces meaningless rates.
|c)Measures rate of events over time. Server sums all values during flush interval, resets to 0 after flush, reports both raw count and per-second rate.
1/rate|@<rate>)|g)Instantaneous value at a point in time. Server stores last value received, retains between flushes (sticky).
+N, -N) modify current value incrementally|ms)Duration of an operation in milliseconds. Server computes per flush interval: count, mean, upper (max), lower (min), sum, stddev, median, configurable percentiles (p90, p95, p99).
|@<rate>)|h)Distribution of values over time. Identical to timer in most implementations. DogStatsD treats histograms as the native distribution type.
|s)Count of unique values per flush interval. Server tracks distinct values, reports cardinality at flush, resets.
|d) — DogStatsD OnlyGlobal distribution across all hosts. Raw values sent to Datadog servers (not aggregated locally). Use when you need accurate fleet-wide percentiles.
See references/dogstatsd.md for distributions vs histograms comparison and
protocol version details.
Format: <namespace>.<subsystem>.<target>.<metric>.<unit>
Example: myapp.api.request.duration.ms, myapp.cache.hit.count.total
myapp.api.requests not just requests.ms, .bytes, .total, .itemshttp_request not httpRequestSee references/naming.md for Graphite namespace mapping, character rules table,
and naming anti-patterns.
Format: metric.name:1|c|#key1:value1,key2:value2 — comma-separated, no spaces.
region:us_eastSet these as global/constant tags on the client — attach to every metric automatically:
| Tag | Purpose | Example |
|---|---|---|
env | Deployment environment | env:production |
service | Service name | service:payment-api |
version | Deployed version | version:2.1.0 |
Rule of thumb: if a tag can have >1000 distinct values, do not use it. Use logs or traces for high-cardinality data.
| Tag | Cardinality | Acceptable? |
|---|---|---|
env:production | ~3-5 | Yes |
method:GET | ~7 | Yes |
status_code:200 | ~20-50 | Yes |
endpoint:/api/users | ~50-200 | Caution |
user_id:12345 | Unbounded | No |
The flush cycle determines metric resolution. Default: 10 seconds.
deleteCounters
config (default: send 0)See references/aggregation.md for flush mechanics, Graphite downsampling rules,
DogStatsD aggregation details, and pre-aggregated timestamps.
Enable client-side buffering — packs multiple metrics into single UDP packets.
Reduces syscall overhead in hot paths. Most modern DogStatsD clients buffer by
default. Call flush() before shutdown.
Client randomly decides whether to send each metric based on sample rate. Datagram
includes |@<rate> so server corrects the count.
| Volume | Recommendation |
|---|---|
| < 1000 metrics/sec | rate=1.0 (no sampling) |
| 1000-10000/sec | rate=0.5 to 0.1 for counters/timers |
| > 10000/sec | rate=0.1 or lower; enable client-side aggregation |
Never sample gauges or sets — server cannot correct for these types.
See references/client-patterns.md for high-throughput tuning steps, error handling,
and Kubernetes deployment patterns.
| Need | Backend |
|---|---|
| Simple, self-hosted graphing | Graphite |
| Cloud monitoring + APM | Datadog (DogStatsD) |
| Prometheus ecosystem integration | statsd_exporter |
| Flexible multi-output pipeline | Telegraf |
| Migrating StatsD to Prometheus | statsd_exporter with relay |
See references/backends.md for statsd_exporter configuration, Telegraf setup,
and migration guides.
When writing StatsD instrumentation:
When reviewing StatsD instrumentation:
The coding skill governs workflow; this skill governs StatsD instrumentation choices.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.