Closed jrouaix closed 4 years ago
@jrouaix , i think something like this may work for you now:
IRollbarPackage package = new ExceptionPackage(exception);
var custom = new Dictionary<string, object>();
custom["BeezUp.Logs.CorrelationID"] = Guid.New; // or whatever you use...
package = new CustomKeyValuePackageDecorator(package, custom);
_rollbar.Error(package);
Let me know if that is nor what you were looking for...
Thank you @akornich but we already have this as a custom value. What we want is the possibility to provide a user generated UUID as it's possible with your rest api (https://explorer.docs.rollbar.com/#operation/create-item) but not exposed by your official client library. Do you have an idea to customize this one without forking your official lib ?
Well, we really need this right away ... forking
https://github.com/BeezUP/Rollbar.NET By the way, i'll have to handle first https://github.com/rollbar/Rollbar.NET/issues/529 Then i'll push a PR
Do you have an idea to customize this one without forking your official lib ?
ping @akornich ?
i am still waiting for the final word from our backend (payload processing) team regarding this one. the UUID is somewhat operationally essential for them. most people I talked suggest that a custom field should be the safest way to go about it. I'll try to get a more definitive answer by tomorrow. stay tuned...
Found your decorators ... could it be as simple as this ?
@jrouaix , correct, a package decorator would be the way to go with custom UUID value. Another option would be to define your own payload transform delegate (but that would be a less flexible option).
@jrouaix , i guess, if you can guarantee the custom UUID value uniqueness, you should be fine. Just FYI, the UUID is used during the payload ingestion process to remove duplicates. To define your own UUID value, your options are:
Rollbar.DTOs.Data
and explicitly set UUID on it, then send it to Rollbar.Option 1 is the recommended way of doing it as the most flexible and reusable one.
@jrouaix, so are good for now can we close this issue? By the way, your PR for offline persistence is included in the latest v3.13.0-beta release. Thanks for the help!
Yep, and it was indeed compatible with older versions of the client, so we didn't have to wait for the vNext. thank you !
Is your feature request related to a problem? Please describe. Well, at https://github.com/BeezUP let's say we don't have only rollbar as a logger, so we have a unique error identifier of our own. Could we have a way to provide it to your api so it can override your UUID creation (https://github.com/rollbar/Rollbar.NET/blob/bf94ed51597b9ffd378e4dfa3c740c15e6ceb0f0/Rollbar/DTOs/Data.cs#L156), so our errorId will match everywhere in the system and many monitoring dashboards.
Describe the solution you'd like Somewhere in those lines, a way to override the UUID prior to send the exception.