Conversation
63aa64c to
ccc2309
Compare
|
Krisztian F (@krisztianfekete) PTAL when you get a chance, thanks! |
Krisztian F (krisztianfekete)
left a comment
There was a problem hiding this comment.
Thanks, added some comments!
|
Krisztian F (@krisztianfekete) Thanks for all of the reviews! While reviewing the timeout handling, I found another distinction worth fixing. Pgconn's own connection timeout can return a The classifier now recognizes pool and connection errors before checking wrapped context errors. I added tests using a controlled dial function to exercise an internal connection timeout and caller cancellation during connection creation. The internal timeout test uses 1 ms and passed 150 consecutive runs with race detection. I also ran Could you please queue the required CI checks, including |
|
Thanks Ridwan Hoq (@ridhoq), they should be running soon! |
1bae163 to
f87a341
Compare
|
Krisztian F (@krisztianfekete) There was an E2E test failure which was fixed upstream, so I rebased onto latest main to pick it up. Could you rerun CI for the updated branch, please? |
|
Krisztian F (@krisztianfekete) ran into an unrelated flakey test documented in #1076. E2E tests passed so hopefully another run should show up green. |
f87a341 to
0c99f26
Compare
|
Krisztian F (@krisztianfekete) ah, looks like #2356 just merged and caused a conflict here. One more run and it should be good to merge if you don't have any other feedback. Thanks! |
0c99f26 to
ba2565d
Compare
|
Krisztian F (@krisztianfekete) just got this rebased and updated if you have a chance to take a look. Thanks! |
750fadf to
902bde9
Compare
Krisztian F (krisztianfekete)
left a comment
There was a problem hiding this comment.
Thanks, added one comment, other than that it just needs tests passing and a rebase!
47c8036 to
8f79745
Compare
|
Krisztian F (@krisztianfekete) looks like checks are passing if you're able to take one more look! Thanks! |
Krisztian F (krisztianfekete)
left a comment
There was a problem hiding this comment.
Thanks!
8f79745 to
6ddbb78
Compare
|
Krisztian F (@krisztianfekete) this is ready for another review and CI run. Now that 1.0 is released, I think it’s okay to merge this. Could you reapprove and queue CI when you get a chance? Thanks! |
Thanks Ridwan Hoq (@ridhoq), this looks good and the content is unchanged from what I approved on 10/30. Per the post-1.0 plan on ate-dev (see mailing list for more details), main only takes urgent stability, correctness and security fixes until 11/17, and many maintainers are at KubeCon this week. This change seems to be fine for v1.1. Once the repo reopens on 11/18, please rebase if needed and I'll re-approve and run CI then. It will land on main for v1.1.x and won't be cherry-picked to release-1.0, since it's a feature. |
6ddbb78 to
46cfd71
Compare
|
Krisztian F (@krisztianfekete) now that the repo is open again, is there anything else needed before this can merge? I've addressed your review comments and checked that it still merges cleanly with latest main. Could you take another look and queue CI when you get a chance? Thanks! |
Report pool occupancy, effective capacity, and acquisition duration and outcomes for the main, watch, and owner pools. Pool hooks capture implicit acquisitions independently of trace sampling, separating connection acquisition delays from subsequent database work. Preserve query tracers and pool ownership, unregister observations on shutdown, and cover SDK collection and real OTLP collector export with PostgreSQL integration tests. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Expose the standard pending_requests instrument so growing acquisition backlogs are visible before attempts complete. Count each acquisition from start to return, including connection creation and validation, and decrement on success, cancellation, timeout, and error. Verify concurrent outstanding requests and zero recovery in SDK tests and positive pending counts through the real OTLP collector export path. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
The PostgreSQL collector integration test imports Docker API and Prometheus model and parser packages directly. Update their existing dependency classifications so module regeneration stays clean without changing versions. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Distinguish closed pools and connection establishment failures with bounded error types instead of reporting every failure as _OTHER. Preserve cancellation and timeout outcomes and classify the returned error chain rather than the current context state. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Precompute pool and outcome attributes on acquisition tracers and reuse upstream OpenTelemetry constructors and descriptions. Keep upstream attributes in the external registry without narrowing their types. Remove redundant library tests and the global-provider collector test, retain production pool and lifecycle coverage, and benchmark acquisition instrumentation. Restore exporter-only dependencies to indirect without changing versions. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Replace the mixed outcome and error-class lookup map with named options. Keep label construction at pool configuration time and make the optional error type explicit in the helper. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Verify the real closed-pool error and its metric classification, describe connect_error as a pgconn connect failure, and remove the unreachable nil-tracer guard. Balance pending requests even when another tracer replaces the acquisition context. Report the missing start time and skip its duration sample instead of panicking, with tests for missing and invalid values and subsequent recording. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Compare acquisition duration with the enclosing elapsed call rather than assuming the acquisition and caller deadlines start together. Warn once per tracer when acquisition context is lost and exercise repeated invalid contexts. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Classify pgconn connection errors before wrapped context errors so internal connection deadlines remain connect_error. Add controlled-dial regressions for internal timeout and caller cancellation, and clarify the documented outcomes. Keep repeated missing-context coverage without inspecting sync.Once internals or introducing a logger dependency solely for warning assertions. Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
Signed-off-by: Ridwan Hoq <943533+ridhoq@users.noreply.github.com>
46cfd71 to
aad30ab
Compare
Expose PostgreSQL pool telemetry through ateapi's existing OpenTelemetry pipeline so database scale tests can distinguish connection acquisition delays from subsequent database work.
Fixes #2288. First slice of #2287.
The four instruments are
db.client.connection.count(used and idle connections),db.client.connection.max(capacity),db.client.connection.wait_time(acquisition duration and outcomes), anddb.client.connection.pending_requests(acquisitions in progress). Pool names are bounded tomain,watch,owner, andprobe. Existing query tracing is preserved, and metrics do not depend on trace sampling.Acquisition duration and pending requests include connection creation and validation, not just queueing. They exclude SQL execution and time holding a connection. The histogram records successful and unsuccessful attempts, with outcomes
success,cancelled,timeout, anderror. Onlyerrorcarrieserror.type:pool_closed,connect_error, or_OTHER. A pgconn connection deadline remainsconnect_error, even when it wraps a context deadline. Connection-hook failures remain_OTHER.Occupancy and capacity callbacks unregister on shutdown and failed initialization preserves pool ownership. The change includes registry entries, operator guidance, and collector E2E expectations. Pending requests extends the original issue scope to expose acquisition backlogs before attempts complete. No dependency versions change.
Validation
Rebased onto
11afdf64. On7a289f36:TestPlatformMetricsEmittedpassed in 32.51 seconds in a disposable Kind cluster with gVisor, Envoy, and the bundled credential provider. A live collector scrape confirmed all four metric families for all four pools. The disposable cluster was removed.go test -race ./...run had one failure in unchangedinternal/benchmarking/glutton.TestUseCPUBurnsCPUTime: it measured 129.25ms of user CPU against a 150ms minimum while builds and other tests were running. Twenty isolated repeats passed. The full run was not green.The full deployed E2E suite and microVM lane have not been run locally. CI still needs to run on the updated head.
Prepared with GitHub Copilot CLI for implementation, review, rebasing, and local validation.