Skip to content

Add Topic Reader delivered metric - #715

Open
KirillKurdyukov wants to merge 1 commit into
masterfrom
codex/topic-reader-metrics
Open

Add Topic Reader delivered metric#715
KirillKurdyukov wants to merge 1 commit into
masterfrom
codex/topic-reader-metrics

Conversation

@KirillKurdyukov

@KirillKurdyukov KirillKurdyukov commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add opt-in Topic client metrics through the existing tech.ydb.core.metrics.Meter abstraction; the default remains Meter.NOOP and metric usage is reported through Observability.
  • Add the ydb.topic.reader.delivered.messages counter with unit {message} and attributes topic and consumer.
  • Record delivered messages immediately before the async callback or immediately before a sync receive successfully returns a message.
  • Add optional reader.name with the exact configured non-empty ReaderName. It is omitted for null/empty names; no fallback identifier is generated, so unnamed readers intentionally aggregate by the other attributes.
  • Do not change Reader receive, session, or commit behavior.

Tests

  • ./mvnw -pl core,topic -am clean test -DskipITs
    • Reactor build successful.
    • Core: 154 tests, 0 failures, 0 errors.
    • Topic: 99 tests, 0 failures, 0 errors, 5 integration tests skipped because no local YDB helper was available.
    • Checkstyle: 0 violations.
  • ./mvnw -pl topic -am -DskipITs -Dtest=ReaderMetricsTest -Dsurefire.failIfNoSpecifiedTests=false test
    • 1 focused test verifies that one message successfully returned by the sync Reader increments the delivered counter from 0 to 1.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.05263% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.07%. Comparing base (98aab78) to head (80fdba0).

Files with missing lines Patch % Lines
...n/java/tech/ydb/topic/read/impl/ReaderMetrics.java 70.58% 1 Missing and 4 partials ⚠️
...va/tech/ydb/topic/impl/TopicClientBuilderImpl.java 60.00% 1 Missing and 1 partial ⚠️
...java/tech/ydb/topic/read/impl/AsyncReaderImpl.java 50.00% 2 Missing ⚠️
...main/java/tech/ydb/topic/read/impl/ReaderImpl.java 50.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (71.05%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #715      +/-   ##
============================================
- Coverage     73.11%   73.07%   -0.05%     
- Complexity     3566     3572       +6     
============================================
  Files           391      392       +1     
  Lines         16497    16531      +34     
  Branches       1730     1733       +3     
============================================
+ Hits          12062    12080      +18     
- Misses         3817     3825       +8     
- Partials        618      626       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KirillKurdyukov
KirillKurdyukov marked this pull request as draft September 3, 2026 10:41
@KirillKurdyukov
KirillKurdyukov marked this pull request as ready for review September 3, 2026 12:17
@KirillKurdyukov
KirillKurdyukov force-pushed the codex/topic-reader-metrics branch 3 times, most recently from 6dad16c to 46d701a Compare September 4, 2026 13:55
@KirillKurdyukov KirillKurdyukov changed the title Add Topic Reader metrics Add Topic Reader delivered metric Sep 4, 2026
@KirillKurdyukov
KirillKurdyukov force-pushed the codex/topic-reader-metrics branch 4 times, most recently from 25987b2 to 3deb1e4 Compare September 7, 2026 07:16
@KirillKurdyukov
KirillKurdyukov force-pushed the codex/topic-reader-metrics branch from 3deb1e4 to 80fdba0 Compare September 7, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant