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

change key to a string alias and KeyValue constructors (#217)

* change key to a string alias and KeyValue constructors

* fix int and uint tests
This commit is contained in:
Gustavo Silva Paiva
2019-10-17 02:49:58 -03:00
committed by rghetia
parent 75562dd381
commit 5e409de1aa
15 changed files with 288 additions and 102 deletions

View File

@@ -48,7 +48,7 @@ func Do(ctx context.Context, f func(ctx context.Context)) {
m := FromContext(ctx)
keyvals := make([]string, 0, 2*len(m.m))
for k, v := range m.m {
keyvals = append(keyvals, k.Name, v.value.Emit())
keyvals = append(keyvals, string(k), v.value.Emit())
}
pprof.Do(ctx, pprof.Labels(keyvals...), f)
}