1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-10-31 00:07:40 +02:00

Global meter forwarding implementation (#392)

* Initial skeleton

* Revert noop provider removal

* Checkpoint

* Checkpoint

* Implement Bound instrument and LabelSet

* Add test

* Add a benchmark

* Add a release test

* Document LabelSetDelegator

* Lint and comments

* Add a second Meter test; fix typo; add a panic

* Add a test for the builtin SDK

* Address feedback
This commit is contained in:
Joshua MacDonald
2019-12-23 23:03:04 -08:00
committed by GitHub
parent 11f67cea8e
commit 1414d363de
15 changed files with 790 additions and 30 deletions

View File

@@ -281,6 +281,9 @@ func (m *SDK) Labels(kvs ...core.KeyValue) api.LabelSet {
// labsFor sanitizes the input LabelSet. The input will be rejected
// if it was created by another Meter instance, for example.
func (m *SDK) labsFor(ls api.LabelSet) *labels {
if del, ok := ls.(api.LabelSetDelegate); ok {
ls = del.Delegate()
}
if l, _ := ls.(*labels); l != nil && l.meter == m {
return l
}