Repository navigation
Conversation
Calculating the size of dropped logs and metrics can be costly in some SDKs. Require byte outcomes (log_byte, trace_metric_byte) only when computing or estimating the size has negligible performance impact, and allow SDKs to omit them otherwise. Item count outcomes remain required. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
The plan checks client errors, runtime missing-file warnings, 404s on the changed spec pages, and page-load volume on those pages. An issue escalates when client errors rise, missing-file warnings appear, or 404s rise while page loads fall. Services: Mention PlanWhat changedThe three spec pages now mark log and metric byte outcomes as optional. SDKs SHOULD record log_byte and trace_metric_byte entries. They MAY omit those entries when size calculation has a performance impact. RiskA render failure in the spec changelog or MDX would 404 or crash those three pages. Readers would lose the spec text. The same page renderer serves sibling SDK telemetry pages. A frontmatter parse error could fail the production build for the whole site. Intended effectThis change is documentation wording. Telemetry does not record the new SHOULD text. There is no queryable intended-effect signal. Absence cannot be told from a flat error rate. Regression watchThese pages share one MDX renderer. A bad changelog or MDX compile can 404 the three pages or fail the site build. Most current errors are Algolia and an
If error events rise, inspect logs for MDX missing-file warnings and new titles from spec changelog render. Not observableThe published SHOULD wording is not in telemetry. Pageload and navigation spans for these URLs returned no rows, so page-scoped latency and page-scoped error events are not available. Get Slack DMs about this change: cursor.com/automations/rollouts |
szokeasaurusrex
left a comment
There was a problem hiding this comment.
Some mostly small thoughts.
I would consider even downgrading further to "MAY," as the performance impact will likely be too high in many cases.
Also, we may want to point implementers to Relay's size calculation, as that is the authoritative calculation, and I believe it may in many cases be more efficient to implement that calculation than to estimate by serializing the log. Though that's just a guess, not supported by benchmarking
|
|
||
| - For `log`, `trace_metric`, and `span` envelope items, which batch multiple items into one envelope item, the quantity is the number of entries in the envelope item's `items` array, not 1. These are recorded under the `log_item`, `trace_metric`, and `span` data categories respectively. | ||
| - For logs and metrics, SDKs **MUST** also record the respective [`log_byte`](#log-byte-outcomes) and [`trace_metric_byte`](#metric-byte-outcomes) entries. | ||
| - For logs and metrics, SDKs **SHOULD** also record the respective [`log_byte`](#log-byte-outcomes) and [`trace_metric_byte`](#metric-byte-outcomes) entries, unless they omit byte outcomes for performance reasons. |
There was a problem hiding this comment.
l: I would even consider downgrading this to "MAY" and clarifying that it should only be permitted when performance impact is acceptable
| - For logs and metrics, SDKs **SHOULD** also record the respective [`log_byte`](#log-byte-outcomes) and [`trace_metric_byte`](#metric-byte-outcomes) entries, unless they omit byte outcomes for performance reasons. | |
| - For logs and metrics, SDKs **MAY** also record the respective [`log_byte`](#log-byte-outcomes) and [`trace_metric_byte`](#metric-byte-outcomes) entries when the performance impact of doing so is acceptable. |
| ### Log Byte Outcomes | ||
|
|
||
| When a log is dropped, SDKs **MUST** record an additional `log_byte` category entry containing the byte size of the log. This provides visibility into the volume of log data being discarded, complementing the item count reported under the `log_item` category. | ||
| When a log is dropped, SDKs **SHOULD** record an additional `log_byte` category entry containing the byte size of the log, if calculating or estimating the log size has only a negligible performance impact. If calculating or estimating the log size has a performance impact, SDKs **MAY** omit `log_byte` entries. This provides visibility into the volume of log data being discarded, complementing the item count reported under the `log_item` category. |
There was a problem hiding this comment.
m: I would remove the redundant sentence. Also, I am pretty sure the comma before the "if" should not be there in US English
l: Also, I would change "negligible" to "acceptable" as it will likely be hard to achieve negligible impact in most cases. If you apply my previous suggestion, the "SHOULD" also should become "MAY"
| When a log is dropped, SDKs **SHOULD** record an additional `log_byte` category entry containing the byte size of the log, if calculating or estimating the log size has only a negligible performance impact. If calculating or estimating the log size has a performance impact, SDKs **MAY** omit `log_byte` entries. This provides visibility into the volume of log data being discarded, complementing the item count reported under the `log_item` category. | |
| When a log is dropped, SDKs **SHOULD** record an additional `log_byte` category entry containing the byte size of the log if calculating or estimating the log size has acceptable performance impact. This provides visibility into the volume of log data being discarded, complementing the item count reported under the `log_item` category. |
| ### Metric Byte Outcomes | ||
|
|
||
| When a metric is dropped, SDKs **MUST** record an additional `trace_metric_byte` category entry containing the byte size of the metric. This provides visibility into the volume of metric data being discarded, complementing the item count reported under the `trace_metric` category. | ||
| When a metric is dropped, SDKs **SHOULD** record an additional `trace_metric_byte` category entry containing the byte size of the metric, if calculating or estimating the metric size has only a negligible performance impact. If calculating or estimating the metric size has a performance impact, SDKs **MAY** omit `trace_metric_byte` entries. This provides visibility into the volume of metric data being discarded, complementing the item count reported under the `trace_metric` category. |
There was a problem hiding this comment.
Same here
| When a metric is dropped, SDKs **SHOULD** record an additional `trace_metric_byte` category entry containing the byte size of the metric, if calculating or estimating the metric size has only a negligible performance impact. If calculating or estimating the metric size has a performance impact, SDKs **MAY** omit `trace_metric_byte` entries. This provides visibility into the volume of metric data being discarded, complementing the item count reported under the `trace_metric` category. | |
| When a metric is dropped, SDKs **SHOULD** record an additional `trace_metric_byte` category entry containing the byte size of the metric if calculating or estimating the metric size has acceptable performance impact. This provides visibility into the volume of metric data being discarded, complementing the item count reported under the `trace_metric` category. |
| SDKs **MUST** report count (`log_item`) and size in bytes (`log_byte`) of discarded log messages. An approximation of log size is sufficient (e.g., by counting as if serialized). | ||
| SDKs **MUST** report the count (`log_item`) of discarded log messages. | ||
|
|
||
| SDKs **SHOULD** also report the size in bytes (`log_byte`) of discarded log messages if calculating or estimating the log size has only a negligible performance impact. If calculating or estimating the log size has a significant performance impact, SDKs **MAY** omit `log_byte` outcomes. An approximation of log size is sufficient (e.g., by counting as if serialized). |
There was a problem hiding this comment.
Same here
| SDKs **SHOULD** also report the size in bytes (`log_byte`) of discarded log messages if calculating or estimating the log size has only a negligible performance impact. If calculating or estimating the log size has a significant performance impact, SDKs **MAY** omit `log_byte` outcomes. An approximation of log size is sufficient (e.g., by counting as if serialized). | |
| SDKs **SHOULD** also report the size in bytes (`log_byte`) of discarded log messages if calculating or estimating the log size has acceptable performance impact. An approximation of log size is sufficient (e.g., by counting as if serialized). |
| SDKs **MUST** report count (`trace_metric`) and size in bytes (`trace_metric_byte`) of discarded metrics. An approximation of metric size is sufficient (e.g., by counting as if serialized). | ||
| SDKs **MUST** report the count (`trace_metric`) of discarded metrics. | ||
|
|
||
| SDKs **SHOULD** also report the size in bytes (`trace_metric_byte`) of discarded metrics if calculating or estimating the metric size has only a negligible performance impact. If calculating or estimating the metric size has a performance impact, SDKs **MAY** omit `trace_metric_byte` outcomes. An approximation of metric size is sufficient (e.g., by counting as if serialized). |
There was a problem hiding this comment.
Same here
| SDKs **SHOULD** also report the size in bytes (`trace_metric_byte`) of discarded metrics if calculating or estimating the metric size has only a negligible performance impact. If calculating or estimating the metric size has a performance impact, SDKs **MAY** omit `trace_metric_byte` outcomes. An approximation of metric size is sufficient (e.g., by counting as if serialized). | |
| SDKs **SHOULD** also report the size in bytes (`trace_metric_byte`) of discarded metrics if calculating or estimating the metric size has acceptable performance impact. An approximation of metric size is sufficient (e.g., by counting as if serialized). |
DESCRIBE YOUR PR
This PR proposes downgrading the emission of log and metric
_byteclient report outcomes fromMUSTtoSHOULD. The primary reason for this are performance concerns for calculating or estimating the byte size of an item that is discarded. Specifically:SDKs SHOULD record byte outcomes if the performance impact is only negligible, but MAY refrain from implementing them if there is a significant performance impact.
A previous benchmark (https://github.com/Lms24/sentry-span-size-benchmark) has shown that for JS and Python, there is a signficant performance cost to estimating sizes.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace
YYYY-MM-DDwith the due date. You can update this information later by editing the PR description.SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: