Skip to content

make write004 safer - #457

Merged
mr-git merged 1 commit into
masterfrom
m/make-write004-blocking
Aug 20, 2026
Merged

mr-git merged 1 commit into
masterfrom
m/make-write004-blocking

Conversation

@mr-git

@mr-git mr-git commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Change the effect wrapping from .delay to .blocking as scraping of metrics might include blocking call(s).

For example the downstream user might add own metric which reads file on .collect.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the reliability of Prometheus metric output generation by running serialization in a blocking-safe context.
    • Standardized metric text encoding to UTF-8 for consistent output.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 89765280-284a-4f52-92e4-654a00caea7d

📥 Commits

Reviewing files that changed from the base of the PR and between eb0c6ff and 5b5c923.

📒 Files selected for processing (2)
  • modules/prometheus/src/main/scala/com/evolutiongaming/smetrics/Prometheus.scala
  • modules/prometheus_v1/src/main/scala/com/evolutiongaming/smetrics/Prometheus.scala

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Prometheus text serialization now runs inside Sync[F].blocking in both modules. The v1 implementation also uses StandardCharsets.UTF_8 for output decoding.

Changes

Prometheus serialization

Layer / File(s) Summary
Blocking serialization and UTF-8 decoding
modules/prometheus/src/main/scala/com/evolutiongaming/smetrics/Prometheus.scala, modules/prometheus_v1/src/main/scala/com/evolutiongaming/smetrics/Prometheus.scala
Both implementations use Sync[F].blocking for serialization. The v1 implementation uses explicit UTF-8 decoding. Scraping and timestamp settings remain unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 5b5c9

This is a small, localized change to metric collection behavior, and no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: making write004 safer by using blocking effect execution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch m/make-write004-blocking

Comment @coderabbitai help to get the list of available commands.

@migesok
migesok self-requested a review August 20, 2026 17:25
@mr-git
mr-git merged commit 24c5bdf into master Aug 20, 2026
5 checks passed
@mr-git
mr-git deleted the m/make-write004-blocking branch August 20, 2026 17:32
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.

2 participants