I have this problem: Datadog traces for my go app all have incorrect errors. That's…
- User
I have this problem: Datadog traces for my go app all have incorrect errors. That's because the http middleware is the one setting the error. But my Go app is a Twirp service and I want to trace the Twirp error instead of a generic 500 internal service error. But I only want to modify the http middleware. What to do? Give mem the code.
Assistant
Here is some code you could use in your HTTP middleware to set the error on Datadog traces based on the Twirp error instead of a generic internal server error:
go
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.