feat(metrics): record terminal PostgreSQL session starts - #1013
Merged
Conversation
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 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.
Summary
duckgres_postgres_session_start_total{org,outcome,reason}exactly once for each authenticated PostgreSQL session startWhy
The alerting follow-up needs a client-impact signal, not a CNPG component or capacity proxy. This counter records the final result after Duckgres has completed its internal session-start work, so the alert can require repeated failures and no successful start for the same organization.
Hard admission-policy rejections caused by an oversized client-requested worker are classified as
client, while runtime worker exhaustion and admission timeouts remaincapacity.Rollout
Deploy this instrumentation before enabling the dependent charts alert. The metric is new and has no historical backfill; the dependent expression remains empty before this version is deployed.
Dependent charts PR: https://github.com/PostHog/charts/pull/13711
Validation
just lintjust test-unitgo test ./controlplane -count=1just test-metricsThe broader
just test-controlplaneand Kubernetes-tagged run reached their Docker-backed cases; those cases could not run because the local OrbStack Docker socket is unavailable. The non-Docker packages and changed control-plane package passed.