diff --git a/otelhelpers/simple_carrier.go b/otelhelpers/simple_carrier.go index 1d2b7d8..c3063c3 100644 --- a/otelhelpers/simple_carrier.go +++ b/otelhelpers/simple_carrier.go @@ -6,9 +6,13 @@ package otelhelpers // but since we're not doing anything else with it, it's fine for this. type SimpleCarrier map[string]string -// Get implements the otel interface for propagation. +// Get implements the otel interface for propagation. Returns empty +// string if the key doesn't exist. func (otp SimpleCarrier) Get(key string) string { - return otp[key] + if v, ok := otp[key]; ok { + return v + } + return "" } // Set implements the otel interface for propagation.