epsagon / epsagon-go

Automated tracing library for Go 1.x ⚡️
https://epsagon.com
MIT License
28 stars 11 forks source link

Fix gin resource type #80

Closed enoodle closed 3 years ago

enoodle commented 3 years ago

There is an issue with the gin wrapper not waiting for the event to actually be processed by the tracer - in that case it will not update the event resource type. Sometimes this happens a lot - depending on the gin server, but usually between the moment the event is added to the moment the wrapper is trying to add the resource type there are no commands that will make the go routine sleep - so it is a toss up between the defer go routine and the tracer go routine..

This will fix this issue by updating the event itself through the wrapper's pointer, so it will be updated even if the tracer haven't processed it.