Class CloudTraceIdExtractor
java.lang.Object
com.google.cloud.spring.logging.extractors.CloudTraceIdExtractor
- All Implemented Interfaces:
TraceIdExtractor
Extracts trace IDs from HTTP requests using the x-cloud-trace-context header.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the header that contains the trace id. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractTraceIdFromRequest(jakarta.servlet.http.HttpServletRequest req) Extract trace ID from the HTTP request.
-
Field Details
-
X_CLOUD_TRACE_HEADER
The name of the header that contains the trace id.- See Also:
-
-
Constructor Details
-
CloudTraceIdExtractor
public CloudTraceIdExtractor()
-
-
Method Details
-
extractTraceIdFromRequest
Description copied from interface:TraceIdExtractorExtract trace ID from the HTTP request.- Specified by:
extractTraceIdFromRequestin interfaceTraceIdExtractor- Parameters:
req- the HTTP servlet request.- Returns:
- the trace ID or null, if none found.
-