rum-metrics-retention

Create RUM-based metrics and manage retention filters for Datadog Real User Monitoring data.

5|2|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/lauhon/pi --skill rum-metrics-retention-lauhon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rum-metrics-retention
Source: https://github.com/lauhon/pi/tree/main/skills/rum-metrics-retention
Command: npx skills add https://github.com/lauhon/pi --skill rum-metrics-retention-lauhon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing custom metrics and long-term data retention for Real User Monitoring requires navigating Datadog's RUM Metrics and Retention Filters APIs, which involves complex query syntax, aggregation rules, and sampling configuration that is error-prone when done manually. ## Core Features & Use Cases - RUM Metrics Management: List, create, update, and delete custom metrics from RUM events with count or distribution aggregations, filters, group-by tags, and percentile support. - Retention Filter Control: Create, update, reorder, and delete retention filters with sample rates from 0-100% to control which RUM events are stored long-term. - Use Case: A frontend team wants to track Core Web Vitals and retain only sessions with errors. Use this Skill to create distribution metrics for LCP, FID, and CLS, then configure a retention filter that keeps 100% of sessions with errors while sampling the rest. ## Quick Start Ask the agent to list all RUM metrics in your organization or create a retention filter for sessions with errors in a specific RUM application.

Frequently Asked Questions about rum-metrics-retention

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a custom metric from RUM events in Datadog?

Use the pup rum metrics create command with an event type, aggregation type, and optional filter and group-by parameters. Count aggregations tally matching events, while distribution aggregations require a numeric path like @view.loading_time and can include percentiles.

How do I control RUM data retention with sampling filters?

Create a retention filter with pup rum retention-filters create, specifying the application ID, event type, query, and sample rate from 0 to 100. Filters are evaluated in order, so the first matching filter determines retention behavior for each event.

What event types are supported for RUM metrics?

RUM metrics support seven event types: session, view, action, error, resource, long_task, and vital. Choose the most specific event type for your measurement, such as vital for Core Web Vitals or view for page load metrics.

Why does creating a distribution RUM metric fail?

Distribution metrics fail when the path parameter is missing, since they require a numeric field like @view.loading_time to measure. Verify the path points to a numeric RUM attribute and that the event type matches the field's availability.

What credentials are required to manage RUM metrics and retention filters?

The pup CLI requires DD_API_KEY and DD_APP_KEY environment variables, plus DD_SITE which defaults to datadoghq.com. Missing credentials produce an error prompting you to export these variables before running commands.