- JSON representation
- LogEntry
- LogSeverity
- HttpRequest
- LogEntryOperation
- LogEntrySourceLocation
- Importance
- TraceSpan
- Attributes
- SpanKind
Represents information regarding an operation.
JSON representation | |
---|---|
{ "operationId": string, "operationName": string, "consumerId": string, "startTime": string, "endTime": string, "labels": { string: string, ... }, "metricValueSets": [ { object ( |
Fields | |
---|---|
operationId |
Identity of the operation. This must be unique within the scope of the service that generated the operation. If the service calls services.check() and services.report() on the same operation, the two calls should carry the same id. UUID version 4 is recommended, though not required. In scenarios where an operation is computed from existing information and an idempotent id is desirable for deduplication purpose, UUID version 5 is recommended. See RFC 4122 for details. |
operationName |
Fully qualified name of the operation. Reserved for future use. |
consumerId |
Identity of the consumer who is using the service. This field should be filled in for the operations initiated by a consumer, but not for service-initiated operations that are not related to a specific consumer.
|
startTime |
Required. Start time of the operation. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
endTime |
End time of the operation. Required when the operation is used in A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
labels |
Labels describing the operation. Only the following labels are allowed:
An object containing a list of |
metricValueSets[] |
Represents information about this operation. Each MetricValueSet corresponds to a metric defined in the service configuration. The data type used in the MetricValueSet must agree with the data type specified in the metric definition. Within a single operation, it is not allowed to have more than one MetricValue instances that have the same metric names and identical label value combinations. If a request has such duplicated MetricValue instances, the entire request is rejected with an invalid argument error. |
logEntries[] |
Represents information to be logged. |
importance |
DO NOT USE. This is an experimental field. |
userLabels |
Private Preview. This feature is only available for approved services. User defined labels for the resource that this operation is associated with. Only a combination of 1000 user labels per consumer project are allowed. An object containing a list of |
traceSpans[] |
Unimplemented. A list of Cloud Trace spans. The span names shall contain the id of the destination project which can be either the produce or the consumer project. |
extensions[] |
Unimplemented. An object containing fields of an arbitrary type. An additional field |
LogEntry
An individual log entry.
JSON representation | |
---|---|
{ "name": string, "timestamp": string, "severity": enum ( |
Fields | ||
---|---|---|
name |
Required. The log to which this log entry belongs. Examples: |
|
timestamp |
The time the event described by the log entry occurred. If omitted, defaults to operation start time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
|
severity |
The severity of the log entry. The default value is |
|
httpRequest |
Optional. Information about the HTTP request associated with this log entry, if applicable. |
|
trace |
Optional. Resource name of the trace associated with the log entry, if any. If this field contains a relative resource name, you can assume the name is relative to |
|
insertId |
A unique ID for the log entry used for deduplication. If omitted, the implementation will generate one based on operationId. |
|
labels |
A set of user-defined (key, value) data that provides additional information about the log entry. An object containing a list of |
|
operation |
Optional. Information about an operation associated with the log entry, if applicable. |
|
sourceLocation |
Optional. Source code location information associated with the log entry, if any. |
|
Union field payload . The log entry payload, which can be one of multiple types. payload can be only one of the following: |
||
protoPayload |
The log entry payload, represented as a protocol buffer that is expressed as a JSON object. The only accepted type currently is An object containing fields of an arbitrary type. An additional field |
|
textPayload |
The log entry payload, represented as a Unicode string (UTF-8). |
|
structPayload |
The log entry payload, represented as a structure that is expressed as a JSON object. |
LogSeverity
The severity of the event described in a log entry, expressed as one of the standard severity levels listed below. For your reference, the levels are assigned the listed numeric values. The effect of using numeric values other than those listed is undefined.
You can filter for log entries by severity. For example, the following filter expression will match log entries with severities INFO
, NOTICE
, and WARNING
:
severity > DEBUG AND severity <= WARNING
If you are writing log entries, you should map other severity encodings to one of these standard levels. For example, you might map all of Java's FINE, FINER, and FINEST levels to LogSeverity.DEBUG
. You can preserve the original severity level in the log entry payload if you wish.
Enums | |
---|---|
DEFAULT |
(0) The log entry has no assigned severity level. |
DEBUG |
(100) Debug or trace information. |
INFO |
(200) Routine information, such as ongoing status or performance. |
NOTICE |
(300) Normal but significant events, such as start up, shut down, or a configuration change. |
WARNING |
(400) Warning events might cause problems. |
ERROR |
(500) Error events are likely to cause problems. |
CRITICAL |
(600) Critical events cause more severe problems or outages. |
ALERT |
(700) A person must take an action immediately. |
EMERGENCY |
(800) One or more systems are unusable. |
HttpRequest
A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.
JSON representation | |
---|---|
{ "requestMethod": string, "requestUrl": string, "requestSize": string, "status": integer, "responseSize": string, "userAgent": string, "remoteIp": string, "serverIp": string, "referer": string, "latency": string, "cacheLookup": boolean, "cacheHit": boolean, "cacheValidatedWithOriginServer": boolean, "cacheFillBytes": string, "protocol": string } |
Fields | |
---|---|
requestMethod |
The request method. Examples: |
requestUrl |
The scheme (http, https), the host name, the path, and the query portion of the URL that was requested. Example: |
requestSize |
The size of the HTTP request message in bytes, including the request headers and the request body. |
status |
The response code indicating the status of the response. Examples: 200, 404. |
responseSize |
The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body. |
userAgent |
The user agent sent by the client. Example: |
remoteIp |
The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: |
serverIp |
The IP address (IPv4 or IPv6) of the origin server that the request was sent to. |
referer |
The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. |
latency |
The request processing latency on the server, from the time the request was received until the response was sent. A duration in seconds with up to nine fractional digits, terminated by ' |
cacheLookup |
Whether or not a cache lookup was attempted. |
cacheHit |
Whether or not an entity was served from cache (with or without validation). |
cacheValidatedWithOriginServer |
Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if |
cacheFillBytes |
The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted. |
protocol |
Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" |
LogEntryOperation
Additional information about a potentially long-running operation with which a log entry is associated.
JSON representation | |
---|---|
{ "id": string, "producer": string, "first": boolean, "last": boolean } |
Fields | |
---|---|
id |
Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. |
producer |
Optional. An arbitrary producer identifier. The combination of |
first |
Optional. Set this to True if this is the first log entry in the operation. |
last |
Optional. Set this to True if this is the last log entry in the operation. |
LogEntrySourceLocation
Additional information about the source code location that produced the log entry.
JSON representation | |
---|---|
{ "file": string, "line": string, "function": string } |
Fields | |
---|---|
file |
Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name. |
line |
Optional. Line within the source file. 1-based; 0 indicates no line number available. |
function |
Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: |
Importance
Defines the importance of the data contained in the operation.
Enums | |
---|---|
LOW |
Allows data caching, batching, and aggregation. It provides higher performance with higher data loss risk. |
HIGH |
Disables data aggregation to minimize data loss. It is for operations that contains significant monetary value or audit trail. This feature only applies to the client libraries. |
TraceSpan
A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a trace contains a root span that describes the end-to-end latency, and one or more subspans for its sub-operations. A trace can also contain multiple root spans, or none at all. Spans do not need to be contiguous—there may be gaps or overlaps between spans in a trace.
JSON representation | |
---|---|
{ "name": string, "spanId": string, "parentSpanId": string, "displayName": { object ( |
Fields | |
---|---|
name |
The resource name of the span in the following format:
[TRACE_ID] is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. |
spanId |
The [SPAN_ID] portion of the span's resource name. |
parentSpanId |
The [SPAN_ID] of this span's parent span. If this is a root span, then this field must be empty. |
displayName |
A description of the span's operation (up to 128 bytes). Stackdriver Trace displays the description in the Google Cloud Platform Console. For example, the display name can be a qualified method name or a file name and a line number where the operation is called. A best practice is to use the same display name within an application and at the same call point. This makes it easier to correlate spans in different traces. |
startTime |
The start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
endTime |
The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
attributes |
A set of attributes on the span. You can have up to 32 attributes per span. |
status |
An optional final status for this span. |
sameProcessAsParentSpan |
(Optional) Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Stackdriver Trace is unable to take advantage of this helpful information. |
childSpanCount |
An optional number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans. |
spanKind |
Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using |
Attributes
A set of attributes, each in the format [KEY]:[VALUE]
.
JSON representation | |
---|---|
{
"attributeMap": {
string: {
object ( |
Fields | |
---|---|
attributeMap |
The set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the Boolean values
An object containing a list of |
droppedAttributesCount |
The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all attributes are valid. |
SpanKind
Type of span. Can be used to specify additional relationships between spans in addition to a parent/child relationship.
Enums | |
---|---|
SPAN_KIND_UNSPECIFIED |
Unspecified. Do NOT use as default. Implementations MAY assume SpanKind.INTERNAL to be default. |
INTERNAL |
Indicates that the span is used internally. Default value. |
SERVER |
Indicates that the span covers server-side handling of an RPC or other remote network request. |
CLIENT |
Indicates that the span covers the client-side wrapper around an RPC or other remote request. |
PRODUCER |
Indicates that the span describes producer sending a message to a broker. Unlike client and server, there is no direct critical path latency relationship between producer and consumer spans (e.g. publishing a message to a pubsub service). |
CONSUMER |
Indicates that the span describes consumer receiving a message from a broker. Unlike client and server, there is no direct critical path latency relationship between producer and consumer spans (e.g. receiving a message from a pubsub service subscription). |