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
Modifier and TypeFieldDescriptionstatic final String
The name of the header that contains the trace id. -
Constructor Summary
-
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:TraceIdExtractor
Extract trace ID from the HTTP request.- Specified by:
extractTraceIdFromRequest
in interfaceTraceIdExtractor
- Parameters:
req
- the HTTP servlet request.- Returns:
- the trace ID or null, if none found.
-