fix(llmobs): do not cancel the context before reading response bodies#4075
Conversation
BenchmarksBenchmark execution time: 2025-10-28 15:27:11 Comparing candidate commit e0c6721 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics. |
gary-huang
left a comment
There was a problem hiding this comment.
just a few comments about log lines
thanks!
| if !strings.Contains(contentType, "application/json") { | ||
| return "" | ||
| } | ||
| // Limit reading to 1KB to avoid reading huge error responses |
There was a problem hiding this comment.
i guess it's fine to start like this but why not read the whole thing? imo this is internal use (for now) so there is no issue with reading big error responses, if anything it would be helpful for debugging?
There was a problem hiding this comment.
makes sense! will change
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
…#4075) Co-authored-by: rodrigo.arguello <[email protected]>
What does this PR do?
We were reading the response body after the request context is canceled, which was triggering an error in the
io.ReadAll(resp.Body)call in certain cases (observed it happening when the response included the headerTransfer-Encoding: chunked).Additionally, it improves the error messages for better debugging and checks for the presence of an app key in
dataset.Pullwhen running in agentless mode, similar as the otherdatasetpublic functions.Motivation
Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!