apache / apache/cassandra-gocql-driver

Observing Final Query Latency

Open
#1,869 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.7k
Forks
658
PR merge metrics
No merged PRs in 30d

Description

Hi,

Current implementation of query observer observes only [individual attempts](https://github.com/apache/cassandra-gocql-driver/blob/trunk/query_executor.go#L61) and does not provide final latency values considering retries and speculative retries. For example:
- if query has 1st attempt for 10ms, then regular retry, and another attempt for 20ms, then both attempts are reported separately, and total 30ms latency isn't be reported;
- if query has 1st attempt for 150ms, and another speculative attempt for 10ms that kicked after 10ms, then 150ms and 10ms attempts are both reported, while non of them represent real 20ms latency.

Is this an expected behaviour and applications are expected to observe real latency?

Contributor guide

Open the contributing guide

Research direction

Start with query_executor.go around line 61 and trace how query observers receive individual attempts, retries, and speculative retries. Compare those paths with the issue's latency examples; done means the expected final-latency behavior is agreed and its observer-facing requirements are clearly recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.