Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing name Metric.unbind #1012

Closed
legendecas opened this issue May 2, 2020 · 1 comment
Closed

Confusing name Metric.unbind #1012

legendecas opened this issue May 2, 2020 · 1 comment

Comments

@legendecas
Copy link
Member

legendecas commented May 2, 2020

@dyladan: An unbound metric can still be unbound again?
Originally posted at #1001 (comment)

Metric.unbind invalidate a previously bound instrument. While the bound instruments can still outlive and recording new values, Metric.unbind merely makes the value of the unbound instruments not been exported.

Another point is that metrics created are not bound by default, i.e. no label values set, and we have two ways to record new values, here counterMetric created by meter.createCounter('foo') is taken for example:

  1. counterMetric.add(value: number, labels: api.Labels)
  2. counterMetric.bind(labels: api.Labels): BoundCounter then boundCounter.add(value: number)

So basically counterMetric itself in the example is not bound but can be unbound by definition.

AFAICT, Metric.unbind is not documented in spec here https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/api-user.md.

@legendecas
Copy link
Member Author

Closing as the issue is no longer applicable.

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

No branches or pull requests

1 participant