bugsnag / bugsnag-go

Automatic panic monitoring for Go and Go web frameworks, like negroni, gin, and revel
https://docs.bugsnag.com/platforms/go
MIT License
204 stars 69 forks source link

export Sanitizer and handle time, errors, stringers #204

Closed veqryn closed 7 months ago

veqryn commented 10 months ago

Goal

Right now, the only way to convert arbitrary any to something bugsnag can show well, is to use the MetaData.AddStruct method. Except it has 3 problems:

Design

This problem can be solved by exporting Sanitizer, and adding some special handling for well known types.

Changeset

See diff

Testing

Add tests pass, and I am using this locally

clr182 commented 8 months ago

Hi @veqryn

Apologies about the delay in response time and thank you for opening this PR with us.

The changes made in this PR seem reasonable. When priority allows will we look to merge this into our go notifier. We will be sure to update you once we have more information to share.

DariaKunoichi commented 8 months ago

Hi @veqryn

Your change is ready to be merged in #215. Except we are still keeping "sanitizer" class private. Did you notice a problem with filters not getting applied? For filters to work you need to set "ParamsFilters" in configuration. Filtering does not occur on each metadata add step - but at the very end, in the "MarshalJSON" function for payload.

If there is still a problem with filters please create an issue with more detailed description.

veqryn commented 8 months ago

Hi @DariaKunoichi , Can I return sanitizer to being private in my PR, and then let this PR get merged? It is nice to have contributor PR's get merged, as then we get credit and it encourages future contributions. thanks

DariaKunoichi commented 8 months ago

Hi, @veqryn of course you can return it to private in your own branch. But unfortunately I still have to cherry pick it in a different PR (and fix CI tests) because our CI will not run for external contributor's PR. You are still credited when I cherry-pick commits from your fork. Your commits will remain in history and you'll be credited in the release notes.

veqryn commented 7 months ago

@DariaKunoichi ok. thank you

mclack commented 7 months ago

Hi @veqryn

This has now been addressed in https://github.com/bugsnag/bugsnag-go/pull/215, which is part of the bugsnag-go v2.3.0 release.

Thank you for your contributions!