-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(tracemetrics): Add trace metrics behind an experiments flag #17883
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
base: develop
Are you sure you want to change the base?
Conversation
This allows the js sdk to send in new trace metric protocol items, although this code is experimental since the schema may still change. Most of this has been copied from logs so some parts may need to be modified / removed later (eg. buffer) but this should allow us to start on UI work by sending in larger amounts of data from sentry js app to test grouping / aggregations etc.
…dd-experimental-metrics
} | ||
if (_enableTraceMetrics) { | ||
_INTERNAL_flushMetricsBuffer(this); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (metricBuffer.length >= MAX_METRIC_BUFFER_SIZE) { | ||
_INTERNAL_flushMetricsBuffer(client, metricBuffer); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Metric Loss During Buffer Flush
When the metric buffer reaches its maximum size, a newly captured metric is added to the buffer before the flush condition is evaluated. If a flush is triggered, it processes the buffer before the new metric was added. Subsequently, the entire buffer is cleared, causing the newly added metric to be lost and never sent.
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
Summary
This allows the js sdk to send in new trace metric protocol items, although this code is experimental since the schema may still change. Most of this has been copied from logs so some parts may need to be modified / removed later (eg. api, buffer) but this should allow us to start on UI work by sending in larger amounts of data from sentry js app to test grouping / aggregations etc.