/trogonstack-datadog:datadog-check-metric-costfrom trogonstack-datadog
Checks if a metric is already collected by Datadog at no extra cost before defining a new one, and estimates custom metric count when it is not.
Ships in trogonstack-datadog. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Datadog bills every metric that does not come from one of its integrations as a custom metric. Before defining a metric, confirm that Datadog does not already collect it at no extra cost, and estimate what it costs if it does not.
Datadog collects metrics from supported OpenTelemetry integrations at no extra cost. A metric is no-cost when it arrives through a supported collection path, such as a receiver that defines it in its metadata.yaml, and is listed in the Metrics Mappings table.
Run scripts/check_metric.py, relative to this skill's directory, with the proposed names. It runs through uv, which installs its dependencies:
scripts/check_metric.py <metric>...
For each name, it reads the live mapping table and reports an exact match on either the OpenTelemetry or the Datadog side, or the closest mapped metrics. It stops with an error when the table cannot be read, so a failed lookup is never reported as a miss. The closest matches are leads, not verdicts: read them, since the Datadog name often differs from the OpenTelemetry one.
When pup is authenticated, the script also checks the current org. It reports whether the metric is billed as custom right now, and which integration it reports through. This is the authoritative answer for metrics that already flow. The counts come from datadog.estimated_usage.metrics.custom.by_metric for indexed custom metrics and datadog.estimated_usage.metrics.custom.ingested.by_metric for ingested ones, which only report for metrics configured with Metrics without Limits. Both are Timeseries pricing estimates, so under Metric Name pricing confirm on the usage page instead. Metrics that do not exist yet can only be checked against the docs. Pass --no-org to skip the org check, and set PUP when pup runs through a wrapper such as mise exec. Pass --json for output another tool can read.
When pup is not available but the Datadog MCP server is connected, run the script with --no-org and do the org check through the MCP tools instead:
max:datadog.estimated_usage.metrics.custom.by_metric{metric_name:<metric>} and max:datadog.estimated_usage.metrics.custom.ingested.by_metric{metric_name:<metric>} over the last day with get_datadog_metric, as scalars with the max aggregator. A value means the metric is billed as custom, and the values are its indexed and ingested custom metric counts. No data from either means it is not counted as custom.get_datadog_metric_context. A "metric not found" error means it is not reporting. Otherwise integration names the integration it reports through.A name match alone does not make a metric no-cost. The no-cost status comes from the collection path, so an application metric that reuses a mapped name is still custom. When a match exists, enable the integration that produces it instead of defining the metric yourself. A renamed or reshaped copy is billed as custom too.
The no-cost families are:
| Area | Source |
|---|---|
| Hosts | Host Metrics (hostmetricsreceiver) |
| Containers | Docker, Podman, Kubernetes |
| Runtimes | Runtime Metrics for Java, .NET, Go, Node.js, and Python, with the matching language integration installed in Datadog |
| Collector | Collector Health Metrics |
| Web servers and proxies | Apache, NGINX, IIS, HAProxy |
| Databases and messaging | MySQL, PostgreSQL, SQL Server, Kafka |
| Big data | Apache Spark |
The Datadog docs warn that a misconfigured receiver can turn these into custom metrics. Configure receivers as their OpenTelemetry documentation describes.
APM computes trace metrics (trace.<SPAN_NAME>.hits, .errors, .duration, and others) from 100% of traffic. With OpenTelemetry, the span_metrics connector produces them, and it must run before any sampling processor. When spans already cover an operation, a hand-written counter or latency histogram for it usually duplicates trace metrics.
Do not confuse these with metrics generated from spans in the trace pipeline. Those are custom metrics.
These are custom metrics:
Datadog bills custom metrics under one of two mutually exclusive models, set by the contract. Ask which one the account uses when it is not known, since the estimate depends on it.
Under Timeseries pricing, Datadog counts one custom metric per unique combination of metric name and tag values, including the host tag. See counting custom metrics.
| Datadog type | Custom metrics per tag combination |
|---|---|
| COUNT, RATE, GAUGE | 1 |
| HISTOGRAM (Agent, DogStatsD) | 5 by default (max, median, avg, 95percentile, count), more when aggregates or percentiles are added |
| DISTRIBUTION | 5 (count, sum, min, max, avg), 10 with percentiles enabled |
Delta and cumulative monotonic OTLP sums map to COUNT, cumulative non-monotonic sums and gauges to GAUGE, and histograms to DISTRIBUTION by default. See OTLP metric types.
An OTLP histogram exported in the Datadog exporter's counters mode also emits one .bucket series per bucket, tagged with lower_bound and upper_bound, so every boundary multiplies the count.
Multiply the per-combination count by the number of unique attribute value combinations the metric is expected to emit. Multiplying the cardinality of every attribute gives the worst case, since Datadog counts only the combinations that actually arrive. Each high-cardinality attribute (IDs, raw paths, free-form strings) multiplies the bill, so drop or bound it before adding the metric.
Each paid host adds 100 ingested and 100 indexed custom metrics on Pro, 200 of each on Enterprise, pooled across the whole account. See allocation.
Under Metric Name pricing, Datadog bills each unique metric name that submits more than 100 indexed datapoints in a month, plus datapoints beyond the volume each name includes. The custom metric definition is the same as under Timeseries pricing.
For each proposed metric, state one of:
trace.* metric that already answers the question.When metrics live in an OpenTelemetry Weaver semantic convention registry, check the registry before generating code from it.
Check every metric the registry defines, including files in nested folders. The script reads definition/2 metrics and older type: metric groups:
scripts/check_metric.py --registry <registry>
For each metric:
dependencies in manifest.yaml instead of copying its definition, so the name, unit, and attributes stay aligned.required, recommended, or opt_in. Count opt_in attributes only if the deployment enables them.annotations.aggregation.parameters.boundaries when the registry sets them. They only change the count in counters mode.To confirm actual billing, check the usage page. Under Timeseries pricing, the estimated usage metrics datadog.estimated_usage.metrics.custom and datadog.estimated_usage.metrics.custom.ingested track custom metric counts.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
npx claudepluginhub trogonstack/agentskills --plugin trogonstack-datadogOther plugins' skills for the same job