Skip to content

docs(sink): fix missing example links and metrics snippet in README - #1014

Open
imitater-dou wants to merge 1 commit into
streamingfast:developfrom
imitater-dou:docs/fix-sink-readme-examples-metrics
Open

imitater-dou wants to merge 1 commit into
streamingfast:developfrom
imitater-dou:docs/fix-sink-readme-examples-metrics

Conversation

@imitater-dou

Copy link
Copy Markdown

Summary

sink/README.md was carried over from the standalone substreams-sink repository when the sink library moved into this repo (#658). Two parts of it no longer match the code in sink/:

  1. Missing example links: the README links to ./examples/basic/ and ./examples/advanced/ (main.go + README.md), but sink/examples/ only contains simple-sink/. All 5 links 404 on GitHub.
  2. Metrics snippet doesn't compile: the "Monitoring and Statistics" snippet uses sink.ProgressMessageProcessedBytes, sink.ProgressMessageTotalProcessedBlocks and sink.DataMessageSizeBytes, none of which exist in the package. The current metrics in sink/metrics.go are ProcessedBytes, ProcessedBlocks (gauges) and MessageSizeBytes (counter). Also, dmetrics Gauge.Get()/Counter.Get() return float64, so %d prints %!d(float64=...).

Changes

  • Point the examples section at ./examples/simple-sink/main.go, and replace the "use the Advanced Example" note with a pointer to the existing Example Implementations section (the production sinks for MongoDB/PostgreSQL, etc.).
  • Use the existing metric variables in the snippet and format them with %.0f.

Docs only. No code changes.

How to verify

ls sink/examples/                      # only simple-sink/
grep -rn "ProgressMessageProcessedBytes\|ProgressMessageTotalProcessedBlocks\|DataMessageSizeBytes" --include=*.go .   # no matches
grep -n "ProcessedBytes\|ProcessedBlocks\|MessageSizeBytes" sink/metrics.go

The sink README still referenced examples/basic and examples/advanced,
which were not carried over when the sink library moved into this repo;
only examples/simple-sink exists. The monitoring snippet also used
metric variables that do not exist in the sink package; use
ProcessedBytes, ProcessedBlocks and MessageSizeBytes instead, and format
the float64 values returned by Get() with %.0f.

Signed-off-by: ADou <ikun3.1415927@gmail.com>
@dfuse-bot
dfuse-bot requested a review from sduchesneau October 27, 2026 02:09
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