Repository navigation
feat(outgoing): surface N+1 outgoing HTTP calls - #18
Merged
Merged
Conversation
laravel-telemetry 3.6 flags one endpoint called over and over with a different id, one call after another, in one trace. Surface it: - OutgoingNPlusOne card on the Outgoing page, grouping http.client.n_plus_one_detected records by call shape, with origin. ReadsQueryRepeats now builds on a generic ReadsRepeatRecords trait that takes the record family's label names; query cards unchanged. - "N+1 detected" tile on Outgoing requests (http_client_requests_n_plus_one_total). - Waterfall groups client spans by laravel.http.client.shape, labels them with url.template, badges laravel.http.client.repeat and notes it on the span. - TraceDiagnosis HTTP shape pass: http flags, http_n_plus_one_shapes / http_call_shapes totals, outgoingRepeats in the trace story, verbose http_shapes in trace_summary, an http_n_plus_one hint in list_traces and an "Outgoing call groups" Markdown snapshot section. Older emitters carry none of these attributes: the card is empty, the tile reads zero and no HTTP flag or total is added. Claude-Session: https://claude.ai/code/session_01LtsaMBeethcCYvKx8PTBYL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surfaces the HTTP-client N+1 detection from cboxdk/laravel-telemetry#84 (core 3.6).
What's new
OutgoingNPlusOne). It readshttp.client.n_plus_one_detectedrecords and groups them bylaravel_http_client_shape. Each row shows the call (GET api.example.com/users/{id}), an exampleurl.full, the origin, the traces affected and the worst repeat. Rows link to the host page.http_client_requests_n_plus_one_total), linking to requests withhttp.client.n_plus_one.count>0.laravel.http.client.shapeand are labelled withurl.template.laravel.http.client.repeat = "n_plus_one"gives the N+1 badge and a note on the span.report.outgoingRepeats), and thehttp.client.n_plus_one.counttotal is labelled.httpsection, with the origin and detailhttp_n_plus_one_shapestotal from the root tally, plushttp_call_shapeshttp_shapesin verbosetrace_summary, anhttp_n_plus_onehint inlist_traces;compare_tracesdiffs the new flags and totals with no extra codeReadsQueryRepeatsnow sits on a genericReadsRepeatRecordstrait that takes the label names. The DB cards' output is unchanged, and their existing tests pass as before.http.client.n_plus_one_detectedrecords.Older core (^3.5 constraint kept): none of the attributes exist there. The card shows its empty state, the tile reads 0 and the HTTP pass adds nothing: no flags and no
http_*totals. Waterfall grouping falls back to method + host as before.Gate:
composer checkgreen (847 passed, 2 skipped).npm testgreen (136).npm run buildwas rebuilt and committed; only themainchunk changed.https://claude.ai/code/session_01LtsaMBeethcCYvKx8PTBYL