Skip to content

GH-5461: Document thread-safety expectations for MeterBinder.bindTo()#7606

Open
won-seoop wants to merge 1 commit into
micrometer-metrics:mainfrom
won-seoop:docs/5461-meter-binder-thread-safety
Open

GH-5461: Document thread-safety expectations for MeterBinder.bindTo()#7606
won-seoop wants to merge 1 commit into
micrometer-metrics:mainfrom
won-seoop:docs/5461-meter-binder-thread-safety

Conversation

@won-seoop

Copy link
Copy Markdown

Summary

Addresses #5461.

MeterBinder.bindTo() had no Javadoc at all, leaving implementors uncertain about whether their implementations need to be thread-safe. Based on the maintainer's guidance in that issue, this PR adds Javadoc to bindTo() that clarifies:

  • It is typically called once per registry at application configuration time.
  • The Micrometer framework does not provide any thread-safety guarantee for concurrent calls to bindTo() on the same instance.
  • Implementations that need to support concurrent binding to multiple registries must ensure their own thread safety.

Test plan

  • No behaviour change (Javadoc only); existing tests pass

🤖 Generated with Claude Code

…terBinder.bindTo()

The MeterBinder interface had no documentation on bindTo(), leaving
implementors uncertain about whether their implementations need to be
thread-safe. Add Javadoc to bindTo() clarifying that: it is typically
called once per registry at configuration time, no concurrent-call
guarantee is provided by the framework, and implementations that need to
support concurrent binding to multiple registries must manage their own
thread safety.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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