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

Support for sending user info? #3

Open
cycomachead opened this issue Jan 25, 2019 · 3 comments
Open

Support for sending user info? #3

cycomachead opened this issue Jan 25, 2019 · 3 comments

Comments

@cycomachead
Copy link

Would you be interested in supporting a set_person() method to send user data to rollbar?
(Happy to contribute a patch!)

@EtienneM
Copy link
Member

EtienneM commented Jan 25, 2019

We welcome every contribution! How do you plan to fill this person attribute? Where would the data come from?

For your information, here is what Rollbar expects regarding person:

    // Optional: person
    // The user affected by this event. Will be indexed by ID, username, and email.
    // People are stored in Rollbar keyed by ID. If you send a multiple different usernames/emails for the
    // same ID, the last received values will overwrite earlier ones.
    "person": {
      // Required: id
      // A string up to 40 characters identifying this user in your system.
      "id": "12345",

      // Optional: username
      // A string up to 255 characters
      "username": "brianr",

      // Optional: email
      // A string up to 255 characters
      "email": "brian@rollbar.com"
    },

From https://docs.rollbar.com/reference#items

@cycomachead
Copy link
Author

What I've done is this:
https://github.com/bromagosa/snapCloud/pull/177/files#diff-d5c255fc66c6740437720ea92cd0815fR145

Essentially you can provide rollbar:set_person({}} with a table of the current user. I don't currently verify that the attributes are correct, since it seems fairly simple -- though I haven't robustly tested the rollbar API, so it might be worth doing a little bit of verification.

@cycomachead
Copy link
Author

And thanks for the quick responses! :) This is definitely a big help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants