Repository navigation
blockstream: count subscriptions closed because they were full - #93
Merged
sduchesneau merged 2 commits intoNov 13, 2026
Merged
sduchesneau merged 2 commits into
sduchesneau merged 2 commits into
Conversation
A subscriber that falls more blocks behind than the subscription channel size is disconnected, which so far only showed as a log line. Add bstream_blockstream_subscriptions_closed_full_total, incremented once per closed subscription and registered when a block stream server is created. Also remove a duplicated CHANGELOG entry for ServerOptionWithSubscriptionChannelSize. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sduchesneau
approved these changes
Nov 13, 2026
sduchesneau
pushed a commit
to streamingfast/firehose-core
that referenced
this pull request
Nov 13, 2026
Picks up streamingfast/bstream#93: bstream_blockstream_subscriptions_closed_full_total counts subscribers (e.g. relayers) a reader disconnected because they fell more blocks behind than the subscription channel size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
bstream_blockstream_subscriptions_closed_full_total, a counter of block stream subscriptions closed because they were full.A subscriber (e.g. a relayer connected to a reader) that falls more blocks behind than the subscription channel size is disconnected (#91 made that size configurable). Until now this only showed as a
reach max buffer size for subcription, closing channellog line, so there was nothing to graph or alert on.Change
blockstream/metrics.go: abstream_blockstreammetric set with one counter,SubscriptionsClosedFull.subscription.Pushincrements it inside the existingquitOnce, so each closed subscription counts once. Blocks pushed after the close aren't counted again.NewUnmanagedServer(and soNewServer) registers the set. A process exports the counter only when it creates a block stream server, and then from 0.dmetrics.Set.Registerignores repeat calls.ServerOptionWithSubscriptionChannelSizeCHANGELOG entry from blockstream: make subscription channel size configurable #91 appeared twice under Unreleased, so I removed the duplicate.The cost is one increment when a subscription is dropped, nothing per block.
Tested
TestBlockServerSubscriptionClosedWhenFullnow also checks the counter: unchanged while the subscription holds up to its size, +1 when it closes, unchanged for blocks pushed after that.TestBlockServerRegistersMetrics: creating a server exports the counter throughprometheus.DefaultGatherer.reader-node-stdin+relayerwith the default subscription size (200), a deliberately slow second subscriber and a 5,000-block burst:/metricsshowedbstream_blockstream_subscriptions_closed_full_total 0before the burst and1after, matching the singlereach max buffer sizelog line.🤖 Generated with Claude Code