Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔊[RUM-4360] monitor more API usages #2745

Merged
merged 2 commits into from
May 13, 2024
Merged

🔊[RUM-4360] monitor more API usages #2745

merged 2 commits into from
May 13, 2024

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented May 6, 2024

Motivation

Provide more visibility on how some SDK APIs are used

Changes

Monitor usage of:

  • startView
  • addAction
  • addError
  • addFeatureFlagEvaluation
  • startDurationVital
  • setGlobalContext
  • setUser

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@bcaudan bcaudan force-pushed the bcaudan/more-usage branch from b63a18f to f480215 Compare May 7, 2024 12:12
Copy link

cit-pr-commenter bot commented May 7, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 157.60 KiB 157.86 KiB 267 B +0.17%
Logs 56.29 KiB 56.29 KiB 0 B 0.00%
Rum Slim 104.09 KiB 104.35 KiB 267 B +0.25%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
adderror 0.030 0.038 0.008
addaction 0.014 0.016 0.002
logmessage 0.005 0.005 -0.000
startview 0.804 0.944 0.140
startstopsessionreplayrecording 0.762 0.799 0.037
addtiming 0.001 0.001 0.000
addglobalcontext 0.001 0.001 0.000

@bcaudan
Copy link
Contributor Author

bcaudan commented May 7, 2024

/to-staging

@dd-devflow
Copy link
Contributor

dd-devflow bot commented May 7, 2024

🚂 Branch Integration: starting soon, merge in < 0s

Commit f480215f9d will soon be integrated into staging-19.

This build is going to start soon! (estimated merge in less than 0s)

Use /to-staging -c to cancel this operation!

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.28%. Comparing base (b0d638c) to head (f480215).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2745   +/-   ##
=======================================
  Coverage   93.27%   93.28%           
=======================================
  Files         241      241           
  Lines        7034     7044   +10     
  Branches     1554     1554           
=======================================
+ Hits         6561     6571   +10     
  Misses        473      473           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dd-mergequeue bot added a commit that referenced this pull request May 7, 2024
Co-authored-by: Bastien Caudan <bastien.caudan@datadoghq.com>
@dd-devflow
Copy link
Contributor

dd-devflow bot commented May 7, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit f480215f9d has been merged into staging-19 in merge commit 8255f230bf.

Check out the triggered pipeline on Gitlab 🦊

@dd-devflow dd-devflow bot added the staging-19 label May 7, 2024
@bcaudan bcaudan force-pushed the bcaudan/more-usage branch from f480215 to bbbbef0 Compare May 7, 2024 12:37
@bcaudan bcaudan marked this pull request as ready for review May 7, 2024 12:56
@bcaudan bcaudan requested a review from a team as a code owner May 7, 2024 12:56
Copy link
Contributor

@N-Boutaib N-Boutaib left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -296,6 +308,7 @@ export function makeRumPublicApi(startRumImpl: StartRum, recorderApi: RecorderAp
*/
addFeatureFlagEvaluation: monitor((key: string, value: any) => {
strategy.addFeatureFlagEvaluation(sanitize(key)!, sanitize(value))
addTelemetryUsage({ feature: 'add-feature-flag-evaluation' })
Copy link
Member

Choose a reason for hiding this comment

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

💭 thought: ‏almost all usages of addTelemetryUsage is only providing a feature name. It could be shorter to change the signature to something like:

addTelemetryUsage("feature", { optional_context: true })

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when introducing the API, I spent some time trying something like this but did not managed to have the typings working.
Don't hesitate to have a shot at it, happy to tweak that in a following PR.

@bcaudan bcaudan merged commit 3c45367 into main May 13, 2024
20 checks passed
@bcaudan bcaudan deleted the bcaudan/more-usage branch May 13, 2024 08:26
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.

5 participants