Conversation
This was referenced Sep 18, 2026
enocom
added this pull request to stack #577
September 19, 2026 04:15
enocom
force-pushed
the
telemetry-8-wire-async-connector
branch
from
September 21, 2026 19:44
d5424ff to
6606d1c
Compare
enocom
force-pushed
the
telemetry-8-wire-async-connector
branch
from
September 23, 2026 03:55
6606d1c to
1ad8c01
Compare
Same wiring as the synchronous Connector: a recorder per instance, one dial_count per dial with a status, dial_latency on success, and the refresh caches reporting under the same instance. enable_builtin_telemetry defaults to False here too. The default flips for both connectors in a change of its own. Two things differ from the synchronous path. asyncpg surfaces a single error for the whole connect, so a PostgresError — the server answered and rejected us — is classified as a user error and everything else as a TCP error, rather than letting tcp_error become a catch-all that hides user mistakes. And open_connections is decremented from an asyncpg termination listener, which Connection._cleanup invokes at most once on both close() and terminate(). Neither byte counts nor mdx_error are reported here: asyncpg exposes no hook for observing bytes on the wire, and the async path performs no metadata exchange.
enocom
force-pushed
the
telemetry-8-wire-async-connector
branch
from
September 24, 2026 02:45
1ad8c01 to
a63fbf8
Compare
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.
Part 8 of 9 in the built-in telemetry stack, splitting what was previously one ~3,200 line commit (#539) into reviewable pieces.
Based on #572 — review that one first; only the last commit here is new.
Unit tests,
ruff check,ruff format --checkandmypyare green at every commit in the stack, not just at the tip.Same wiring as the synchronous Connector: a recorder per instance, one
dial_count per dial with a status, dial_latency on success, and the
refresh caches reporting under the same instance.
enable_builtin_telemetry defaults to False here too. The default flips
for both connectors in a change of its own.
Two things differ from the synchronous path. asyncpg surfaces a single
error for the whole connect, so a PostgresError — the server answered and
rejected us — is classified as a user error and everything else as a TCP
error, rather than letting tcp_error become a catch-all that hides user
mistakes. And open_connections is decremented from an asyncpg termination
listener, which Connection._cleanup invokes at most once on both close()
and terminate().
Neither byte counts nor mdx_error are reported here: asyncpg exposes no
hook for observing bytes on the wire, and the async path performs no
metadata exchange.
The stack (merges bottom to top):
_metadata_exchangehelperInstrumentedSocketGroup A (1–3) is independent of telemetry and could ship on its own, and carries no breaking change: dial failures are classified for the metric by tagging the exception in #572, not by changing the type callers see. Group B (4–8) is inert because
enable_builtin_telemetrydefaults toFalsethroughout. #574 flips that default, so reverting it alone turns the whole feature off.