dd-trace-go icon indicating copy to clipboard operation
dd-trace-go copied to clipboard

More precise span error in gin middleware

Open theo303 opened this issue 1 year ago • 1 comments

Hello ! First of all, excuse me if I'm using the wrong tool/place to ask a question, I'm not used to this.

I'm wondering if I can improve how errors are displayed in datadog for my http requests (I'm using gin). Now I have this: image I would like ideally to have a full go error displayed here.

I guess it's the default behavior because the gin middleware calls FinishRequestSpan(). Since this function is deferred after all handlers have finished, it will override the error in the span if I try to set it before ?

Is this the desired behavior ? Should I make my own middleware and stop using the one in contrib/gin-gonic ?

Thanks !

theo303 avatar Aug 09 '24 13:08 theo303

@theo303 Thanks for reaching out! This is something we've found in other contribs. Allow us to review it internally and we'll come back to you.

darccio avatar Aug 09 '24 13:08 darccio