Skip to content

Replace statsd-client with statsd-instrument#5278

Merged
johha merged 1 commit into
mainfrom
replace-statsd-client
Jul 14, 2026
Merged

Replace statsd-client with statsd-instrument#5278
johha merged 1 commit into
mainfrom
replace-statsd-client

Conversation

@johha

@johha johha commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

statsd-ruby has not been released in 5+ years and the repo is archived. Shopify/statsd-instrument is well maintained and gets regular releases.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@johha johha force-pushed the replace-statsd-client branch 3 times, most recently from df1e0ff to a288ce2 Compare July 13, 2026 10:29
@johha johha changed the title Replace statsd-client with dogstatsd-ruby Replace statsd-client with statsd-instrument Jul 13, 2026
@johha johha force-pushed the replace-statsd-client branch from a288ce2 to 49a83b3 Compare July 13, 2026 11:35
statsd-ruby has not been released in 5+ years and its repo is archived.
Shopify's statsd-instrument is actively maintained and, unlike
dogstatsd-ruby, emits synchronously over a UDP sink with no background
threads or telemetry -- behaving like the old client.

The metric emitters (StatsdUpdater, the deployment updater scheduler and
the diego sync job) call StatsD::Instrument::Client directly: timing ->
measure (|ms), decrement -> increment(name, -1), and the grouping batch
blocks become plain sequential calls since sends are synchronous. The
emitted wire format is byte-identical (verified against a UDP listener),
so the downstream statsd agent is unaffected.

The UDP sink is memoized per address in the dependency locator. Unlike
statsd-ruby (whose socket is GC-reclaimed), statsd-instrument pins its
socket in a thread-local store that is never freed, so building a fresh
sink on every statsd_client rebuild (once per test example via #reset)
would leak a socket each time. One long-lived sink per address keeps it
to a single socket -- correct for this singleton in production.
@johha johha force-pushed the replace-statsd-client branch from 49a83b3 to 55ce780 Compare July 13, 2026 11:45
@johha johha merged commit d5486c2 into main Jul 14, 2026
13 checks passed
@johha johha deleted the replace-statsd-client branch July 14, 2026 14:13
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Jul 14, 2026
Changes in cloud_controller_ng:

- Replace statsd-client with statsd-instrument
    PR: cloudfoundry/cloud_controller_ng#5278
    Author: Johannes Haass <johannes.haass@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants