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

Support use of synchronous instruments in async callbacks (#725)

* Support use of synchronous instruments in async callbacks

* Add a test
This commit is contained in:
Joshua MacDonald
2020-05-19 21:33:10 -07:00
committed by GitHub
parent c5f2252c48
commit 1fab21ddbf
13 changed files with 78 additions and 47 deletions

View File

@ -73,7 +73,7 @@ func main() {
commonLabels := []kv.KeyValue{lemonsKey.Int(10), kv.String("A", "1"), kv.String("B", "2"), kv.String("C", "3")}
oneMetricCB := func(result metric.Float64ObserverResult) {
oneMetricCB := func(_ context.Context, result metric.Float64ObserverResult) {
result.Observe(1, commonLabels...)
}
_ = metric.Must(meter).RegisterFloat64ValueObserver("ex.com.one", oneMetricCB,