This repository was archived by the owner on Oct 8, 2026. It is now read-only.
Repository navigation
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Test Impact PlanDeterministic summary of how this PR changes tests, CI runners, and coverage-risk signals. Summary
Signals
Coverage risk: neutral or increased No coverage-reduction warnings detected. |
This was referenced Oct 1, 2026
EDsCODE
marked this pull request as ready for review
October 7, 2026 14:43
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Customers who query through Trino get no monitoring in PostHog's Data ops scene. The product monitoring API reports only DuckDB workers and pgwire sessions, and Trino queries never pass through either. This PR adds a tenant-safe Trino counterpart for the PostHog backend to read.
The PostHog side that reads these routes is PostHog/posthog#110369.
GET /api/v1/orgs/:id/monitoring/trino/snapshotreturns the org's Trino lifecycle state, its tier's concurrency and queue limits, in-flight totals, and up to 200 in-flight queries, longest-running first.GET /api/v1/orgs/:id/monitoring/trino/seriesreturns one of nine allow-listed metrics, over the same windows as the DuckDB series route.?and comments removed. Text that cannot be lexed becomes a fixed placeholder.available: falsemarks a snapshot whose coordinator or org index could not be read. Zero totals are then not mistaken for an idle warehouse.Note
The new series are labelled by
org: about 45 series per Trino-enabled org. Finished-query counts are best-effort and are not for billing.docs/metrics.mdhas the details.Semantics to check
in_flightrunningin_flight = running + queuedblockedrunning: Trino stateRUNNINGwith every driver blockedlongest_running_msorgselector on every template; the gauge takes the maximum across podsKnown limits
Validation
unknown; another cell's orgs get no series; gauges clear on poll failure, on stop, and when an org leaves the cell.TestTrinoUsageCollectorToleratesOverlappingRunsfails under-racewithout the mutex.$ORG; unknown metrics, DuckDB-only metrics, and unknown windows are rejected before Prometheus is called.go test -tags kubernetes ./controlplane/admin ./controlplane/provisioner,go test -race -tags kubernetes -run Trino ./controlplane, andjust lint.Agent context
Human-driven, agent-assisted. Written with Claude Code: Claude Opus 5.5 planned and coordinated, Claude Sonnet subagents wrote the code task by task, and a separate reviewer model reviewed each task and the whole branch before this PR was opened. The collector mutex and the log lines on the two unavailable paths came out of that whole-branch review.
🤖 Generated with Claude Code