-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Feature Request: Allow Breadcrumb data to accept objects as values #88
Comments
Currently Sentry doesn't really support a serialized object in its I think this could be a feature request opened on Sentry and if implemented, change the SDKs which is a coordinated thing now as align the API. |
@lunim I'll close this as per my comment above. |
It seems that this feature is now implemented: getsentry/sentry-javascript#623 (comment) Can we reopen this perhaps? |
It's a bit of an issue to take Forcing this to be |
For me it would be fine to serialize the data client side. for example I
have protobuf messages that are easily serializable to JSON and I would
like to display them in the breadcrumbs, as json objects.
For this, only one extra overload would be needed, which accepts a JSON
serialized string
|
It currently accepts There are different extension method, for example accepting a value tuple:
|
I see, thanks for your reply. Looking at it, I have two questions:
Thinking about it more, I suppose that as long as the Sentry UI displays the string values as is, including whitespace and linebreaks, then it doesn't really matter whether or not it understands JSON, since we can include a pretty-printed json string in the breadcrumbs. I will experiment with this approach. |
Those extensions are available when adding directly to the event or to the scope. The latter is what SentrySdk.ConfigureScope(s => s.AddBreadcrumb(...)
Not sure I follow. What do you mean by the top level The fields at the level of the breadcrumb (ie.: its properties) are typed and you can't add data that's not specified in the documentation above.
Sounds good! I hope this works out. |
@boukeversteegh @lunim looks like @bruno-garcia answered this one. |
Sorry to keep this open. My current workaround is to pass a dictionary like this; Dictionary<string, string> data = new();
data.Add(key, JsonFormatter.Format(message)); // formats a Protobuf message to JSON
SentrySdk.AddBreadcrumb(description, category, null, data); It's just shown as a string, and the json structure is not handled in any way, but it's workable for small messages. Haven't tested yet with formatted/multiline strings. Closing this is OK I suppose. Thanks! |
Currently, the breadcrumb accepts additional data as a dictionary of <string,string>. Allowing objects as values would remove the need for end-users to serialize. Currently, the SentryEvent extras accepts <string,object>, updating breadcrumb to be the same would be useful.
The text was updated successfully, but these errors were encountered: