Skip to content

Commit

Permalink
Remove NoopObservationRegistry.INSTANCE
Browse files Browse the repository at this point in the history
This breaks the circular reference between NoopObservationRegistry and
ObservationRegistry through ObservationRegistry.NOOP.

Closes micrometer-metricsgh-4096

Co-authored-by: Tadaya Tsuyukubo <[email protected]>
  • Loading branch information
jonatan-ivanov and ttddyy committed Sep 23, 2023
1 parent a8f078d commit b368729
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@
*/
final class NoopObservationRegistry implements ObservationRegistry {

/**
* Instance of {@link NoopObservationRegistry}.
*/
static final NoopObservationRegistry INSTANCE = new NoopObservationRegistry();

static final ObservationRegistry FOR_SCOPES = ObservationRegistry.create();

private final ObservationConfig observationConfig = NoopObservationConfig.INSTANCE;

private NoopObservationRegistry() {
NoopObservationRegistry() {
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static ObservationRegistry create() {
/**
* No-op implementation of {@link ObservationRegistry}.
*/
ObservationRegistry NOOP = NoopObservationRegistry.INSTANCE;
ObservationRegistry NOOP = new NoopObservationRegistry();

/**
* When previously set will allow to retrieve the {@link Observation} at any point in
Expand Down

0 comments on commit b368729

Please sign in to comment.