1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-20 23:59:41 +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

@ -52,7 +52,7 @@ func main() {
observerLock := new(sync.RWMutex)
observerValueToReport := new(float64)
observerLabelsToReport := new([]kv.KeyValue)
cb := func(result metric.Float64ObserverResult) {
cb := func(_ context.Context, result metric.Float64ObserverResult) {
(*observerLock).RLock()
value := *observerValueToReport
labels := *observerLabelsToReport