Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #900 +/- ##
==========================================
+ Coverage 82.61% 82.63% +0.02%
==========================================
Files 99 99
Lines 12939 12968 +29
Branches 1268 1272 +4
==========================================
+ Hits 10689 10716 +27
- Misses 1798 1800 +2
Partials 452 452
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Pull request type
What is the current behavior?
The SDK does not expose a metric showing whether topic messages are being received into the local reader buffer. It is therefore difficult to distinguish a lack of incoming progress from application-side consumption or decoding problems.
Topic readers also do not expose a public option for assigning a reader name that can be used to distinguish metric series.
Issue Number: N/A
What is the new behavior?
This PR adds the
ydb.topic.reader.received.messagescounter.The counter is incremented by the number of messages in a batch after the batch has been accepted into the SDK's local reader buffer and before message decoding. This allows decoding or application-consumption problems to be diagnosed by comparing the received-message rate with a delivered-message metric.
The metric has the following attributes:
endpointdatabasetopicconsumerreader.nameThe
partitionattribute is intentionally excluded to keep the metric series stable when partition assignments change. For reads without a consumer, theconsumerattribute is set to an empty string.An optional
reader_nameargument is added to both synchronous and asynchronous topic reader APIs. A user-provided value is also forwarded in the topic read initialization request. If the value is omitted or empty, the SDK generates a process-local name in the formreader-N. The resolved name remains stable across reader reconnects.The counter is registered in the OpenTelemetry metrics provider with the
{message}unit. The metrics build-info token is updated toydb-sdk-metrics/0.2.0.Unit tests and observability documentation are updated accordingly.
Other information
The metric context belongs to the logical topic reader and is shared by all underlying stream readers created during reconnects.
No new dependencies are introduced.