feat(rum): add rum_metrics resource - #715
Open
michael-richey wants to merge 2 commits into
Open
michael-richey wants to merge 2 commits into
michael-richey wants to merge 2 commits into
Conversation
This was referenced Sep 25, 2026
michael-richey
commented
Sep 25, 2026
michael-richey
left a comment
Collaborator
Author
There was a problem hiding this comment.
Solid addition.
Highlights:
- Model implementation is consistent with existing
spans_metricssemantics. - The POST-409 fallback to GET-by-id + PATCH is a strong reliability pattern for
skip_resource_mapping=Trueresources. - Tests cover happy path plus non-409 re-raise behavior, which is exactly what we want.
No blocking issues found in this PR diff.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation follows established resource patterns and has focused unit coverage for its key behaviors.
Review effort: Balanced
Findings: None
What changed in this PR
Adds rum_metrics synchronization with full CRUD support and conflict recovery for pre-existing destination metrics.
Changes:
- Implements and registers the
RUMMetricsresource model. - Adds unit coverage for CRUD and 409 fallback behavior.
- Documents
rum_metricsas a supported, dependency-free resource.
| File | Description |
|---|---|
datadog_sync/model/rum_metrics.py |
Implements RUM metric synchronization. |
datadog_sync/models/__init__.py |
Registers the new resource model. |
tests/unit/test_rum_metrics.py |
Covers CRUD and conflict handling. |
README.md |
Documents resource support and dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
michael-richey
force-pushed
the
michael.richey/add-rum-applications-tests
branch
from
October 1, 2026 20:37
628a03c to
db40ee8
Compare
michael-richey
force-pushed
the
michael.richey/add-rum-metrics
branch
3 times, most recently
from
October 1, 2026 21:16
0b8775f to
062e450
Compare
Add the rum_metrics resource type (RUM-based metrics, /api/v2/rum/config/metrics), modeled on spans_metrics: skip_resource_mapping=True, full CRUD, and a 409-on-create fallback that hydrates state.destination via GET-by-id then PATCHes — so a first run against a pre-populated destination does not fail permanently on a metric-name conflict. - datadog_sync/model/rum_metrics.py (new) — RUMMetrics model - datadog_sync/models/__init__.py — register RUMMetrics - tests/unit/test_rum_metrics.py (new) — 8 unit tests pinning get/import/create/ update/delete and the 409 fallback contract - README.md — add rum_metrics to the supported-resources and dependency tables Integration tests + VCR cassettes are deferred (require sandbox-org API access to record) and will be added in a follow-up.
State in the README, import short help, and import docstring that import reads from the source organization into local state and writes to no Datadog organization. Closes #501 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
michael-richey
force-pushed
the
michael.richey/add-rum-metrics
branch
from
October 2, 2026 01:45
062e450 to
90ac6fb
Compare
Collaborator
Author
|
Nice addition overall. The model/test shape is consistent with A couple things I liked in particular:
No blocking issues from my side on this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First RUM resource in the RUM initiative. Adds
rum_metrics(RUM-based metrics,/api/v2/rum/config/metrics), modeled onspans_metrics:skip_resource_mapping=True, full CRUD, and a 409-on-create fallback that hydratesstate.destinationvia GET-by-id then PATCHes — so a first run against a pre-populated destination does not fail permanently on a metric-name conflict.Stacked on top of #714 (the
rum_applicationsprep PR).Changes
datadog_sync/model/rum_metrics.py(new) —RUMMetricsmodel,resource_type="rum_metrics",base_path="/api/v2/rum/config/metrics",skip_resource_mapping=True.datadog_sync/models/__init__.py— registerRUMMetrics.tests/unit/test_rum_metrics.py(new) — 8 unit tests pinningget_resources,import_resource(by-id + passthrough),create_resource,update_resource,delete_resource, and the 409 fallback contract (GET-by-id → hydrate state → PATCH) plus non-409 reraise.README.md— addrum_metricsto the supported-resources and dependency tables (no dependencies).Testing
pytest tests/unit/test_rum_metrics.py→ 8 passedpytest tests/unit/test_rum_metrics.py tests/unit/test_rum_applications.py→ 15 passedNotes / follow-up
Integration tests + VCR cassettes are deferred — recording requires sandbox-org API access not available in this session. The model behavior is fully covered by unit tests (
AsyncMockclients, same pattern astest_spans_metrics_409_fallback.py). A follow-up will addtests/integration/resources/test_rum_metrics.py(subclassingBaseResourcesTestClass,field_to_update="attributes.filter.query") and record the 8 cassettes.