feat: trace httpapi.{Read,Write}#4134
Conversation
| ctx, span := tracing.StartSpan(ctx) | ||
| defer span.End() |
There was a problem hiding this comment.
Why do we care about tracing this? It seems like this function is so simple, that it's weird to trace.
There was a problem hiding this comment.
For httpapi.Read I would agree, but that was mostly to make them consistent. I thought it would be weird if one was traced and the other wasn't.
httpapi.Write is a lot more useful. JSON marshaling can sometimes take a non-insignificant amount of time, and this could help us catch outliers. Additionally, we can enrich span data a bit more since we have access to the actual interface{} we're marshalling, such as the number of elements in an array, which could help us spot routes that need to be paginated.
There was a problem hiding this comment.
Toss this gorgeous comment next to httpapi.Write and I'll approve!
No description provided.