Package com.google.cloud.logging
Class Context.Builder
java.lang.Object
com.google.cloud.logging.Context.Builder
- Enclosing class:
- Context
A builder for objects.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a object for this builder.loadCloudTraceContext
(String cloudTrace) Sets the trace id and span id values by parsing the string which represents xCloud Trace Context.loadW3CTraceParentContext
(String traceParent) Sets the trace id and span id values by parsing the string which represents the standard W3C trace context propagation header.setReferer
(String referer) Sets the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.setRemoteIp
(String remoteIp) Sets the IP address (IPv4 or IPv6) of the client that issued the HTTP request.setRequest
(HttpRequest request) Sets the HTTP request.Sets the HTTP request method.setRequestUrl
(String url) setServerIp
(String serverIp) Sets the IP address (IPv4 or IPv6) of the origin server that the request was sent to.Sets the string as a span id value.setTraceId
(String traceId) Sets the string as a trace id value.
-
Method Details
-
setRequest
Sets the HTTP request. -
setRequestUrl
-
setRequestMethod
Sets the HTTP request method. -
setReferer
Sets the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.- See Also:
-
setRemoteIp
Sets the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples:192.168.1.1
,FE80::0202:B3FF:FE1E:8329
. -
setServerIp
Sets the IP address (IPv4 or IPv6) of the origin server that the request was sent to. Examples:192.168.1.1
,FE80::0202:B3FF:FE1E:8329
. -
setTraceId
Sets the string as a trace id value. -
setSpanId
Sets the string as a span id value. -
loadCloudTraceContext
Sets the trace id and span id values by parsing the string which represents xCloud Trace Context. The Cloud Trace Context is passed asx-cloud-trace-context
header (can be in Pascal case format). The string format isTRACE_ID/SPAN_ID;o=TRACE_TRUE
.- See Also:
-
loadW3CTraceParentContext
Sets the trace id and span id values by parsing the string which represents the standard W3C trace context propagation header. The context propagation header is passed astraceparent
header. The method currently supports ONLY version"00"
. The string format is00-TRACE_ID-SPAN_ID-FLAGS
. field of theversion-format
value.- Throws:
IllegalArgumentException
- if passed argument does not follow the @W3C trace format or the format version is not supported.- See Also:
-
build
Creates a object for this builder.
-