Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Rename metric instrument "Handles" to "Bound Instruments" #70

Merged
merged 3 commits into from
Dec 13, 2019

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Nov 27, 2019

The topic of "Handle" being too general purpose has come up repeatedly. Each time this proposed renaming is discussed, people seem to agree it's an improvement.


This is a simple renaming. All uses of "handle" will be replaced by
"bound instrument" in the specification. All uses of the `GetHandle`
method become `Bind`.
Copy link
Member

Choose a reason for hiding this comment

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

How about GetBoundInstrument() as it makes it more clear that this method returns something. (like GetHandle() .

Bind() may be wrongly interpreted as an action or something one can use to manually bind instrument and labelset as in like meter.Bind(labelset, instrument)

Copy link
Member

Choose a reason for hiding this comment

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

It is an action, it creates a new object, bound instrument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an action, but @cijothomas is pointing out that "Bind" doesn't imply that it returns something.

I could be convinced to move the Bind() method to the Meter as you have done, and to use a GetBoundX method on the instrument, but this method will just call Bind() (which will return something) and I'm not sure it's an improvement in clarity.

@jmacd jmacd added the metrics Relates to the Metrics API/SDK label Dec 12, 2019
Copy link
Member

@c24t c24t left a comment

Choose a reason for hiding this comment

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

Looks like a straightforward improvement, IMO "bound" is less ambiguous than "handle".

@bogdandrutu bogdandrutu merged commit db02c50 into open-telemetry:master Dec 13, 2019
@jmacd jmacd deleted the jmacd/otep_bound_instrument branch May 6, 2020 18:48
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 30, 2024
carlosalberto pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Nov 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
metrics Relates to the Metrics API/SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants