feat(database_observability): add wait_event_v2 op with pre-classified wait_event_type#6105
Open
feat(database_observability): add wait_event_v2 op with pre-classified wait_event_type#6105
Conversation
…d wait_event_type Introduces wait_event_v2 as an alternative to the baseline wait_event op. When enable_pre_classified_wait_events is set in the query_samples block, Alloy emits wait_event_v2 instead of wait_event, with wait_event_type pre-classified at emit time (IO Wait / Lock Wait / Network Wait / Other Wait) rather than computed via label_replace at query time. MySQL classification: wait/io/* -> IO Wait, wait/lock/* -> Lock Wait, wait/synch/* -> Synch Wait. Postgres classification: IO -> IO Wait, Lock/LWLock/... -> Lock Wait, Client -> Network Wait, default -> Other Wait.
Contributor
|
💻 Deploy preview available (feat(database_observability): add wait_event_v2 op with pre-classified wait_event_type): |
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
Introduces
wait_event_v2as an alternative to the baselinewait_eventop for both MySQL and PostgreSQL.When
enable_pre_classified_wait_events = trueis set in thequery_samplesblock, Alloy emitswait_event_v2entries instead ofwait_event, withwait_event_typepre-classified at emit time rather than computed via a multi-levellabel_replacechain at query time.Classification
MySQL (
wait_event_name→wait_event_type):wait/io/*→IO Waitwait/lock/*,wait/synch/*→Lock Waitwait/io/socket/*→Network WaitPostgreSQL (raw
wait_event_type→ classifiedwait_event_type):IO→IO WaitLock,LWLock,Activity,Extension,InjectionPoint,IPC,Timeout,BufferPin→Lock WaitClient→Network WaitOther WaitWhy
Pre-classifying at emit time eliminates the Loki 500-series fallback retry loop that causes 2–7s tail latency at wide unfiltered windows. Benchmark results: −83 to −90% p95 on WaitEventsPanel duration queries.
Changes
wait_event_v2op added (MySQL + Postgres)enable_pre_classified_wait_eventsflag inquery_samplesblock (both components)classifyMySQLWaitEventType/classifyPostgresWaitEventTypewith unit testsTest plan
TestQuerySamples_WaitEvents_PreClassified,TestClassifyMySQLWaitEventType,TestClassifyPostgresWaitEventType)wait_evententries in Lokiwait_event_v2entries with pre-classifiedwait_event_type🤖 Generated with Claude Code