Skip to content

Conversation

@cdn34dd
Copy link
Contributor

@cdn34dd cdn34dd commented Jan 4, 2026

What does this PR do?

Prevent the flattening of nested attributes when handling internal attributes, so that native functionality remains unchanged.

Motivation

Incorrect handing of internal attributes:

const original = {
    '_dd.resource_timings': {
        firstByte: { duration: 56845703, startTime: 1767547597328000000 },
        download: { duration: 2200439, startTime: 1767547597384845800 },
        fetch: { duration: 59046143, startTime: 1767547597328000000 }
    }
};

const flattened = {
    '_dd.resource_timings.firstByte.duration': 56845703,
    '_dd.resource_timings.firstByte.startTime': 1767547597328000000,
    '_dd.resource_timings.download.duration': 2200439,
    '_dd.resource_timings.download.startTime': 1767547597384845800,
    '_dd.resource_timings.fetch.duration': 59046143,
    '_dd.resource_timings.fetch.startTime': 1767547597328000000
};

Correct V2 - https://mobile-integration.datadoghq.com/rum/sessions?query=%40type%3Asession %40application.id%3A056b6201-48cb-4acc-9fbc-48507b8e3e12&agg_m=count&agg_m_source=base&agg_t=count&event=AwAAAZtvNgjglADQwwAAABhBWnR2TmhLOUFBQXNpR0tzbE8ycHpBQUUAAAAkMDE5YjZmMzYtNWMzNS00ZDRmLWEwZGQtZThmY2FjODAxMzc3AAAAJg&fromUser=false&from_ts=1767028516231&to_ts=1767114916231&live=true

Incorrect V3 - https://mobile-integration.datadoghq.com/rum/sessions?query=%40type%3Asession %40application.id%3A056b6201-48cb-4acc-9fbc-48507b8e3e12&agg_m=count&agg_m_source=base&agg_t=count&event=AwAAAZtwObGPi4g5iAAAABhBWnR3T2I5TUFBREFZUVROTzQ1czhRQUQAAAAkZDE5YjcwMzktYjE4Zi00MDEzLWE4Y2QtMDI5N2E2OTZmNWFlAAAAAA&fromUser=false&from_ts=1767028752423&to_ts=1767115152423&live=true

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 4, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 231f76f | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@cdn34dd cdn34dd force-pushed the carlosnogueira/RUM-13565/incorrect-encoding-internal-attributes branch from 95c9976 to 02bce97 Compare January 5, 2026 14:53
@cdn34dd cdn34dd force-pushed the carlosnogueira/RUM-13565/incorrect-encoding-internal-attributes branch from 02bce97 to 231f76f Compare January 5, 2026 15:00
@cdn34dd cdn34dd marked this pull request as ready for review January 5, 2026 15:01
@cdn34dd cdn34dd requested a review from a team as a code owner January 5, 2026 15:01
encodeAttributesInPlace(v, result, [k], allEncoders, context);
// Internal SDK attributes (starting with '_dd.') should not be flattened
// as they have a specific structure expected by the native SDK
if (k.startsWith('_dd.')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice catch! 👏

@cdn34dd cdn34dd merged commit 7ee4c51 into feature/v3 Jan 5, 2026
9 checks passed
@cdn34dd cdn34dd deleted the carlosnogueira/RUM-13565/incorrect-encoding-internal-attributes branch January 5, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants