diff --git a/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java b/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java index d41f097d..c4882619 100644 --- a/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java +++ b/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java @@ -39,11 +39,12 @@ */ public final class XCloudTraceContextPropagator implements TextMapPropagator { - private static String FIELD = "x-cloud-trace-context"; - private static Collection FIELDS = Collections.singletonList(FIELD); - private static Pattern VALUE_PATTERN = + private static final String FIELD = "x-cloud-trace-context"; + private static final Collection FIELDS = Collections.singletonList(FIELD); + private static final Pattern VALUE_PATTERN = Pattern.compile("(?[0-9a-f]{32})\\/(?[\\d]{1,20});o=(?\\d+)"); - private static Logger LOGGER = Logger.getLogger("XCloudTraceContextPropogator"); + private static final Logger LOGGER = + Logger.getLogger(XCloudTraceContextPropagator.class.getCanonicalName()); private final boolean oneway;