fix: typo

This commit is contained in:
Kevin Franklin Kim 2022-09-12 08:24:27 +02:00
parent a5bdcaf541
commit e2096b6b1d

View File

@ -8,10 +8,10 @@ import (
type labelerContextKeyType int
const lablelerContextKey labelerContextKeyType = 0
const labelerContextKey labelerContextKeyType = 0
func injectLabeler(ctx context.Context, l *otelhttp.Labeler) context.Context {
return context.WithValue(ctx, lablelerContextKey, l)
return context.WithValue(ctx, labelerContextKey, l)
}
// LabelerFromContext retrieves a Labeler instance from the provided context if
@ -19,7 +19,7 @@ func injectLabeler(ctx context.Context, l *otelhttp.Labeler) context.Context {
// Labeler is returned and the second return value is false. In this case it is
// safe to use the Labeler but any attributes added to it will not be used.
func LabelerFromContext(ctx context.Context) (context.Context, *otelhttp.Labeler) {
l, ok := ctx.Value(lablelerContextKey).(*otelhttp.Labeler)
l, ok := ctx.Value(labelerContextKey).(*otelhttp.Labeler)
if !ok {
l = &otelhttp.Labeler{}
ctx = injectLabeler(ctx, l)