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

Report dropped spans in client reports #88

Open
21 of 24 tasks
cleptric opened this issue Jun 26, 2024 · 5 comments
Open
21 of 24 tasks

Report dropped spans in client reports #88

cleptric opened this issue Jun 26, 2024 · 5 comments

Comments

@cleptric
Copy link
Member

cleptric commented Jun 26, 2024

Description

SDKs that emit client reports today should record an additional dropped span category event when a transaction is dropped, containing the number of the spans inside the transaction plus one.
The plus one stems from the fact that Relay extracts an additional span from the transaction. If a transaction contains no spans, we still want to report one dropped transaction and one dropped span. This also applies to transactions that are not sampled.
If certain spans are dropped in beforeSendTransaction, an event processor etc., we also want to report those if feasible.

{
	"discarded_events": [
		{
			"reason": "something",
			"category": "transaction",
			"quantity": 1
		},
		{
			"reason": "something",
			"category": "span",
			"quantity": 3 // 2 spans + 1 span (the transaction itself should be counted)
		}
	]
}

See https://www.notion.so/sentry/Rate-Limited-Outcomes-for-Nested-Spans-in-Transactions-1ba24e34bdb64e9498aa5c03ecb28ba0?d=eeb2093683d541f5996e6eb804713236#3c019a03b165493d989440bc67c8c5be for more details.


SDKs which emit standalone spans today, should additionally implement handling span category rate limits, which only apply to standalone spans.

Why should we be doing this?

We need to to be able to report over quota and other rejection stats for AM3 customers. As we currently do not emit this data, the billing page shows spans as zero.

Why now?

We didn’t understand the full extend of the reporting of outcomes before hand, hence this came up post AM3 launch.

Stakeholder(s)

@phacops @cleptric

Team(s)

All SDK teams

SDKs

  1. mydea
  2. szokeasaurusrex
  3. enhancement
    sl0thentr0py
  4. Platform: Android Platform: Java
    stefanosiano
  5. jamescrosswell
  6. Platform: Cocoa
    denrase
  7. 3 of 3
    Platform: Dart
    buenaflor
  8. 3 of 3
    Platform: React-Native
  9. 3 of 3
    Platform: Capacitor Status: Backlog
@cleptric cleptric self-assigned this Jun 26, 2024
@stephanie-anderson stephanie-anderson added this to the Implementation milestone Jul 4, 2024
@stephanie-anderson stephanie-anderson modified the milestones: [3] Implementation, Tracing Jul 10, 2024
@krystofwoldrich
Copy link
Member

@cleptric Recording of dropped spans is currently implemented in JS v8, which means RN SDK will have it in the next major version, when updated to v8. Is that okay, or should we backport the recording to JS v7?

@kahest
Copy link
Member

kahest commented Jul 30, 2024

@cleptric on sentry-native we don't have client reports yet (updated tasklist accordingly) - lmk if we need to implement client reports from scratch for this

@cleptric
Copy link
Member Author

@krystofwoldrich when will the next RN major ship?

@kahest No, we agreed on only doing this for SDKs already supporting client reports. I still think each SDK should have them one day, but no need to do this right now.

@kahest
Copy link
Member

kahest commented Jul 30, 2024

@cleptric the next RN major is scheduled for early September, so in about a month

@krystofwoldrich
Copy link
Member

I opened getsentry/sentry-javascript#13343 to port this to v7. So RN and Capacitor can just bump the JS version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

6 participants