Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53286

Enable Sentry user capturing

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • evergreen
    • None
    • Evergreen - Milestone 1

    Description

      User capturing is not enabled, hence makes it harder to automatically correlate messages from the same user in Sentry UI

      When working on JENKINS-53251, I see the "User" field on the top right always at 0:

      Expected behavior

      Reading https://docs.sentry.io/learn/context/#capturing-the-user, I think that we only have to change our code in two places in sentry.js.

      Instead of

      Raven.captureMessage(data.log.message, {
        level: data.log.level.toLowerCase(),
        logger: data.log.name,
        extra: {
          uuid: data.uuid,
          source: data.log
        }
      });
      

      We should use `id` field instead of `uuid`, i.e.:

      Raven.captureMessage(data.log.message, {
        level: data.log.level.toLowerCase(),
        logger: data.log.name,
        extra: {
          id: data.uuid,
          source: data.log
        }
      });
      

      Attachments

        Issue Links

          Activity

            So it does not work, and Sentry support confirms I didn't do the right thing.

            I sent

            Hello,
            
            Since recently, we'd modified our code to also send an `id` along with our messages to "capture the user" (https://docs.sentry.io/learn/context/#capturing-the-user).
            
            But for instance for `EVERGREEN-1E` I still see the "USERS" field stay at 0 when I do see the `id` specified.
            
            Can you help and tell us what we're missing here?
            
            FWIW, here is the PR where we thought we enabled the feature: https://github.com/jenkins-infra/evergreen/pull/204
            
            Thanks!
            

            They answered:

            	
            Katie [REDACTED] (Sentry)
            
            Sep 7, 11:10 MST
            
            Good morning!
            
            Thanks for reaching out. I think the trouble you're running into is that there's a difference between "user" context and "extra" context. Check out the examples here. Extra context is basically a collection of arbitrary key-value pairs which can be useful information for you, but which don't map to the user in any way. User context, on the other hand, is mapped to the user field in the event.
            
            Hope this helps. Please let me know if you have any other questions.
            
            Thanks,
            Katie
            Sentry Support Engineer
            
            batmat Baptiste Mathus added a comment - So it does not work, and Sentry support confirms I didn't do the right thing. I sent Hello, Since recently, we'd modified our code to also send an `id` along with our messages to "capture the user" (https://docs.sentry.io/learn/context/#capturing-the-user). But for instance for `EVERGREEN-1E` I still see the "USERS" field stay at 0 when I do see the `id` specified. Can you help and tell us what we're missing here? FWIW, here is the PR where we thought we enabled the feature: https://github.com/jenkins-infra/evergreen/pull/204 Thanks! They answered: Katie [REDACTED] (Sentry) Sep 7, 11:10 MST Good morning! Thanks for reaching out. I think the trouble you're running into is that there's a difference between "user" context and "extra" context. Check out the examples here. Extra context is basically a collection of arbitrary key-value pairs which can be useful information for you, but which don't map to the user in any way. User context, on the other hand, is mapped to the user field in the event. Hope this helps. Please let me know if you have any other questions. Thanks, Katie Sentry Support Engineer
            rtyler R. Tyler Croy added a comment -

            Looks like we got this deployed!

            rtyler R. Tyler Croy added a comment - Looks like we got this deployed!

            We did. We now definitely have that feature enabled in Sentry UI.

            batmat Baptiste Mathus added a comment - We did. We now definitely have that feature enabled in Sentry UI.

            People

              rtyler R. Tyler Croy
              batmat Baptiste Mathus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: