Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ type Scope interface {

// Capabilities returns a description of metrics reporting capabilities.
Capabilities() Capabilities

// Close closes the scope and releases any resources.
// For root scopes, this will also close the reporter.
// For subscopes, this will clear all metrics and remove the scope from the registry.
// Returns an error if the scope is already closed.
Close() error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't do this - it's a breaking change to add a method to a go interface in semver terms

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've introduced a new ClosableScope interface to embed Scope with a Close() method

}

// Counter is the interface for emitting counter type metrics.
Expand Down