Skip to content

Capture SDK analytics #6256

Closed
Closed

Description

@lobsterkatie

Problem Statement

It's helpful to know how people are using our SDK. For example, in the past we've wondered things like:

  • How many nextjs SDK users are deployed to Vercel?
  • Do most people use us via npm or CDN? Of the ones who use us via CDN, how many use the tunneling option?
  • How widely-used is ? How many of those people are actually using the current version of the SDK?

and so on and so forth.

In order for this to be useful, however, we also need a) for relay to not drop the data as something it doesn't recognize, and b) for it to be queryable somewhere. This issue is meant to track both that larger meta project and specific instances where we implement various analytics.

Solution Brainstorm

Prerequisite non-SDK work

  1. Work with the ingest and data teams to figure out
  • Where in the event to store the data
  • What changes are necessary in relay
  • How the data will be accessed
  1. Make necessary non-SDK changes
  • relay
  • ??? (wherever querying will happen, if changes are necessary there)

Work to add specific metrics to the SDK

Activity

  1. harishfalco commented on Dec 6, 2022

    @harishfalco

    Hi @lobsterkatie . We are developing an SDK and we use sentry to log errors. When a client intergrates our product, the error in client application (not realted our sdk) are also got logged in our sentry . How to implement sentry to capture only our sdk errors ?

    I know one approach is to wrap every function inside try catch block . My question is are there any other ways to accomplish this task?

  2. lobsterkatie commented on Dec 7, 2022

    @lobsterkatie
    MemberAuthor

    Hi, @harishfalco.

    This issue is about us reporting on how our SDK is being used, rather than using our SDK to monitor another SDK.

    Solving the problem you're asking about requires having multiple hubs play nicely together, which turns out to be harder than you'd think! Definitely something we're thinking about but not something we've yet fully figured out and implemented. The workaround you mentioned (combined with creating your own hub) is one way to get as close to the ideal as possible. Running the SDK like normal and filtering errors in beforeSend is another.

    Relevant issues can be found here. If you find one which is more specific to your situation, please feel free to post there and add your use case.

  3. harishfalco commented on Dec 12, 2022

    @harishfalco

    Hey @lobsterkatie . beforeSend implemenation works fine for us . But In our sentry is initialised two times .
    1 ) On our client app
    2) On our own sdk
    While initializing second sentry instance(i.e in our own sdk) we are getting an error like

    helpers.ts:120 Uncaught TypeError: t.update is not a function
        at t.captureSession (baseclient.ts:189:15)
        at Ft.J (hub.js:402:1)
        at Ft.captureSession (hub.js:328:1)
        at Ir (sdk.ts:204:7)
        at sdk.ts:237:3
        at t.init (sdk.ts:99:5)
        at WebSDK.sentryInit (sdk.js:169:12)
        at HTMLScriptElement.<anonymous> (sdk.js:76:16)
        at HTMLScriptElement.sentryWrapped (helpers.ts:98:1)
    

    I tried using namespace during initialisation of second instance , but that doesn't seem to work.

  4. lobsterkatie commented on Dec 12, 2022

    @lobsterkatie
    MemberAuthor

    Hi, @harishfalco.

    Since the problem you're talking about is different than the one this issue is meant to address, can you please either add your question to one of the existing issues I referenced above, or open a new issue? Thanks!

  5. harishfalco commented on Dec 12, 2022

    @harishfalco
  6. AbhiPrasad commented on Jan 18, 2023

    @AbhiPrasad
    Contributor

    Closing as we are going to track work here instead - getsentry/team-webplatform-meta#11

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions