Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Track how often breadcrumbs are dropped by SDKs #116

Closed

Description

@AbhiPrasad

Description

For the upcoming logging product, we want to leverage breadcrumbs in the SDK. To get a better understanding of how breadcrumbs are created and used by the SDK, we would like to track how often breadcrumbs are dropped by the SDK.

We can do this with client outcomes in the SDK.

Why should we be doing this?

In short we want to know: "How many breadcrumbs are being dropped by Sentry". If we can get this number for at least JavaScript, Python, and a single mobile SDK, we can make much better decisions around how the logging product will proceed at Sentry.

Why now?

We're working on logs - we want to ship soon, so this is important.

RFC

No response

Slack-Channel

#proj-structured-logs

Notion Document(s)

No response

Stakeholder(s)

@getsentry/product-owners-explore-logs

Team(s)

Web Frontend

SDKs

## Pre-work
- [ ] https://github.com/getsentry/sentry-docs/pull/12395
- [ ] https://github.com/getsentry/snuba/pull/6792
## SDKs
- [ ] https://github.com/getsentry/sentry-javascript/pull/15082
- [ ] https://github.com/getsentry/sentry-python/pull/3993
## Post SDK Work
- [ ] Create dashboard to track these stats

TBD on the mobile SDK

Activity

  1. self-assigned this
    on Jan 14, 2025
  2. AbhiPrasad commented on Jan 14, 2025

    @AbhiPrasad
    Author
    diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts
    index 995be01bb..52bd4aae5 100644
    --- a/packages/core/src/scope.ts
    +++ b/packages/core/src/scope.ts
    @@ -481,7 +481,11 @@ export class Scope {
     
         const breadcrumbs = this._breadcrumbs;
         breadcrumbs.push(mergedBreadcrumb);
    -    this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;
    +
    +    if (breadcrumbs.length > maxCrumbs) {
    +      this._client?.recordDroppedEvent('breadcrumb_dropped', 'log', 1);
    +      this._breadcrumbs = breadcrumbs.slice(-maxCrumbs);
    +    }
     
         this._notifyScopeListeners();

    Approx implementation in the JS SDK.

    We need to decide what data category the breadcrumb data belongs to, and what the outcome name will be.

  3. AbhiPrasad commented on Jan 16, 2025

    @AbhiPrasad
    Author

    data categories: getsentry/relay#4455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions