Skip to content

Feature/topic writer metrics - #940

Draft
NastyaKa wants to merge 9 commits into
ydb-platform:mainfrom
NastyaKa:feature/topic-writer-metrics
Draft

NastyaKa wants to merge 9 commits into
ydb-platform:mainfrom
NastyaKa:feature/topic-writer-metrics

Conversation

@NastyaKa

@NastyaKa NastyaKa commented Nov 7, 2026

Copy link
Copy Markdown

Pull request type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Topic Writers do not expose client-side metrics.

What is the new behavior?

Adds metrics for explicitly named Topic Writers:

  • Counters: sending.messages, sending.bytes, written.messages, session.errors
  • Gauges: buffer.used.bytes, buffer.limit.bytes, sending.oldest_age
  • Histograms: buffer.wait.duration, message.processing.duration, compression.duration, message.ack.duration

Includes sync/async support, retry/reconnect handling, OpenTelemetry integration, documentation, and tests.

@NastyaKa
NastyaKa marked this pull request as draft November 7, 2026 10:40
@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.86352% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.30%. Comparing base (e231157) to head (cf0a34d).

Files with missing lines Patch % Lines
ydb/observability/metrics.py 89.60% 21 Missing and 29 partials ⚠️
ydb/_topic_reader/topic_reader_asyncio.py 95.65% 6 Missing and 1 partial ⚠️
ydb/_topic_writer/topic_writer_asyncio.py 96.62% 2 Missing and 1 partial ⚠️
ydb/_topic_reader/topic_reader_sync.py 60.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #940      +/-   ##
==========================================
+ Coverage   82.70%   83.30%   +0.60%     
==========================================
  Files          99       99              
  Lines       12960    13638     +678     
  Branches     1266     1366     +100     
==========================================
+ Hits        10718    11361     +643     
- Misses       1789     1802      +13     
- Partials      453      475      +22     
Flag Coverage Δ
integration 80.55% <83.98%> (+0.16%) ⬆️
unit 50.36% <55.24%> (+1.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ydb/_grpc/grpcwrapper/ydb_topic.py 86.15% <100.00%> (+0.04%) ⬆️
ydb/_topic_reader/datatypes.py 96.89% <100.00%> (+1.35%) ⬆️
ydb/_topic_reader/topic_reader.py 91.46% <100.00%> (+0.43%) ⬆️
ydb/_topic_writer/topic_writer.py 86.38% <100.00%> (+0.51%) ⬆️
ydb/observability/__init__.py 100.00% <ø> (ø)
ydb/opentelemetry/metrics_plugin.py 96.15% <100.00%> (+0.15%) ⬆️
ydb/topic.py 86.01% <ø> (ø)
ydb/_topic_reader/topic_reader_sync.py 73.17% <60.00%> (+1.01%) ⬆️
ydb/_topic_writer/topic_writer_asyncio.py 90.93% <96.62%> (+2.02%) ⬆️
ydb/_topic_reader/topic_reader_asyncio.py 89.53% <95.65%> (+2.87%) ⬆️
... and 1 more

... and 1 file with indirect coverage changes

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

This branch has not been deployed

No deployments
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