Skip to content

Conversation

cy-moi
Copy link
Collaborator

@cy-moi cy-moi commented Aug 27, 2025

Motivation

Expose feature operation step vitals public APIs

Changes

  • add FeatureOperation Apis in RumPublicApi
  • add usage telemetry
  • add operation step vital in vitalCollection

Test instructions

Go on staging
Call apis from console
See events sent

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@cy-moi cy-moi force-pushed the congyao/ops-vital branch from 4001e3a to 1fe1863 Compare August 27, 2025 10:23
Copy link

datadog-official bot commented Aug 27, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 94.44%
Total Coverage: 92.29% (+0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 481fce8 | Docs | Was this helpful? Give us feedback!

Copy link

cit-pr-commenter bot commented Aug 27, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 157.25 KiB 158.14 KiB 910 B 0.57%
Rum Recorder 19.53 KiB 19.53 KiB 0 B 0.00%
Rum Profiler 5.18 KiB 5.18 KiB 0 B 0.00%
Logs 55.74 KiB 55.73 KiB -4 B -0.01%
Flagging N/A 931 B 931 B N/A%
Rum Slim 114.99 KiB 115.82 KiB 847 B 0.72%
Worker 23.60 KiB 23.60 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.005 0.008 0.002
addaction 0.019 0.024 0.004
addtiming 0.006 0.007 0.000
adderror 0.025 0.023 -0.002
startstopsessionreplayrecording 0.001 0.001 -0.000
startview 0.006 0.007 0.002
logmessage 0.029 0.021 -0.008
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 25.19 KiB 26.04 KiB 866 B
addaction 44.59 KiB 46.66 KiB 2.07 KiB
addtiming 24.83 KiB 24.81 KiB -24 B
adderror 50.20 KiB 51.16 KiB 978 B
startstopsessionreplayrecording 24.18 KiB 24.01 KiB -182 B
startview 422.52 KiB 431.12 KiB 8.60 KiB
logmessage 41.24 KiB 42.93 KiB 1.69 KiB

🔗 RealWorld

@cy-moi cy-moi force-pushed the congyao/ops-vital branch 2 times, most recently from 7cd5619 to 494418a Compare August 28, 2025 13:18
@cy-moi
Copy link
Collaborator Author

cy-moi commented Aug 28, 2025

/to-staging

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Aug 28, 2025

View all feedbacks in Devflow UI.

2025-08-28 13:26:42 UTC ℹ️ Start processing command /to-staging


2025-08-28 13:27:02 UTC ℹ️ Branch Integration: starting soon, merge expected in approximately 15m11s (p90)

Commit 494418a708 will soon be integrated into staging-35.


2025-08-28 13:37:02 UTC ℹ️ Branch Integration: this commit was successfully integrated

Commit 494418a708 has been merged into staging-35 in merge commit 2764d2b44d.

Check out the triggered pipeline on Gitlab 🦊

If you need to revert this integration, you can use the following command: /code revert-integration -b staging-35

@cy-moi cy-moi force-pushed the congyao/ops-vital branch from 494418a to 714e048 Compare August 28, 2025 13:33
dd-mergequeue bot added a commit that referenced this pull request Aug 28, 2025
@cy-moi cy-moi marked this pull request as ready for review August 29, 2025 11:22
@cy-moi cy-moi requested a review from a team as a code owner August 29, 2025 11:22
@cy-moi cy-moi force-pushed the congyao/ops-vital branch 2 times, most recently from 17cda02 to acc2518 Compare September 2, 2025 14:55
@mormubis
Copy link
Contributor

mormubis commented Sep 3, 2025

@cy-moi rebase and let's see those e2e errors are gone

export interface FeatureOperationOptions extends VitalOptions {
operationKey?: string
}
export interface FullFeatureOperationOptions extends FeatureOperationOptions {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Rename FullFeatureOperationOptions to FailFeatureOperationOptions

Comment on lines 810 to 818
succeedFeatureOperation: monitor((name, options) => {
addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'succeed' })
strategy.addOperationStepVital(name, 'end', options)
}),

failFeatureOperation: monitor((name, options) => {
addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'fail' })
strategy.addOperationStepVital(name, 'end', options)
}),
Copy link
Member

Choose a reason for hiding this comment

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

question: how do you distinguish between succeed and fail if the user is not providing a failureReason?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, failureReason should be required.

Copy link
Collaborator Author

@cy-moi cy-moi Sep 4, 2025

Choose a reason for hiding this comment

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

I made the type changes (mentioned in comments below) based on this as well.

vital: vitalData,
type: RumEventType.VITAL,
context,
...(valueComputedBySdk && { _dd: { vital: { computed_value: true } } }),
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: I'm not sure what valueComputedBySdk is, but it looks like it's always true, so maybe we can simplify?

Copy link
Collaborator Author

@cy-moi cy-moi Sep 4, 2025

Choose a reason for hiding this comment

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

Ah wait, this one should be false when customers use addDurationVital and compute their own values right? I think we can either remove this or we change how start or stop calling addDurationVital under the hood to pass in valueComputedBySdk.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Per discussion on slack, we are removing this value because it was only relevant to the pre-GA vital and is no longer in use.

@cy-moi cy-moi changed the title ✨ [RUM-11398] Add feature operation step vital APIs ✨⚗️[RUM-11398] Add feature operation step vital APIs Sep 15, 2025
@cy-moi
Copy link
Collaborator Author

cy-moi commented Sep 15, 2025

/to-staging

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Sep 15, 2025

View all feedbacks in Devflow UI.

2025-09-15 09:43:26 UTC ℹ️ Start processing command /to-staging


2025-09-15 09:43:36 UTC ℹ️ Branch Integration: starting soon, merge expected in approximately 0s (p90)

Commit 481fce8c3e will soon be integrated into staging-38.


2025-09-15 09:54:29 UTC ℹ️ Branch Integration: this commit was successfully integrated

Commit 481fce8c3e has been merged into staging-38 in merge commit a25fe54e56.

Check out the triggered pipeline on Gitlab 🦊

If you need to revert this integration, you can use the following command: /code revert-integration -b staging-38

dd-mergequeue bot added a commit that referenced this pull request Sep 15, 2025
@cy-moi cy-moi merged commit 7f704e0 into main Sep 15, 2025
20 checks passed
@cy-moi cy-moi deleted the congyao/ops-vital branch September 15, 2025 11:12
rgaignault pushed a commit that referenced this pull request Sep 15, 2025
* Add feature operation step vital apis

* update sanitzation

* Update API signature

* Update specific types and jsdocs

* Make failureReason required

* Update packages/rum-core/src/boot/rumPublicApi.ts

Co-authored-by: Benoît <[email protected]>

* fix-comment: remove computedValueBySdk

* Update rum-event-format and remove unused ff

* Leverage type from schema updates

---------

Co-authored-by: Benoît <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants