Operation

Represents information regarding an operation.

JSON representation
{
  "operationId": string,
  "operationName": string,
  "consumerId": string,
  "startTime": string,
  "endTime": string,
  "labels": {
    string: string,
    ...
  },
  "metricValueSets": [
    {
      object(MetricValueSet)
    }
  ],
  "logEntries": [
    {
      object(LogEntry)
    }
  ],
  "importance": enum(Importance)
}
Fields
operationId

string

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

string

Fully qualified name of the operation. Reserved for future use.

consumerId

string

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.

  • This can be in one of the following formats:
    • project:PROJECT_ID,
    • project_number:PROJECT_NUMBER,
    • api_key:API_KEY.

startTime

string (Timestamp format)

Required. Start time of the operation.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

endTime

string (Timestamp format)

End time of the operation. Required when the operation is used in ServiceController.Report, but optional when the operation is used in ServiceController.Check.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

Labels describing the operation. Only the following labels are allowed:

  • Labels describing monitored resources as defined in the service configuration.
  • Default labels of metric values. When specified, labels defined in the metric value override these default.
  • The following labels defined by Google Cloud Platform:
    • cloud.googleapis.com/location describing the location where the operation happened,
    • servicecontrol.googleapis.com/userAgent describing the user agent of the API request,
    • servicecontrol.googleapis.com/service_agent describing the service used to handle the API request (e.g. ESP),
    • servicecontrol.googleapis.com/platform describing the platform where the API is served, such as App Engine, Compute Engine, or Kubernetes Engine.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

metricValueSets[]

object(MetricValueSet)

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[]

object(LogEntry)

Represents information to be logged.

importance

enum(Importance)

DO NOT USE. This is an experimental field.

LogEntry

An individual log entry.

JSON representation
{
  "name": string,
  "timestamp": string,
  "severity": enum(LogSeverity),
  "httpRequest": {
    object(HttpRequest)
  },
  "trace": string,
  "insertId": string,
  "labels": {
    string: string,
    ...
  },
  "operation": {
    object(LogEntryOperation)
  },

  // Union field payload can be only one of the following:
  "protoPayload": {
    "@type": string,
    field1: ...,
    ...
  },
  "textPayload": string,
  "structPayload": {
    object
  }
  // End of list of possible types for union field payload.
}
Fields
name

string

Required. The log to which this log entry belongs. Examples: "syslog", "book_log".

timestamp

string (Timestamp format)

The time the event described by the log entry occurred. If omitted, defaults to operation start time.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

severity

enum(LogSeverity)

The severity of the log entry. The default value is LogSeverity.DEFAULT.

httpRequest

object(HttpRequest)

Optional. Information about the HTTP request associated with this log entry, if applicable.

trace

string

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 //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824

insertId

string

A unique ID for the log entry used for deduplication. If omitted, the implementation will generate one based on operationId.

labels

map (key: string, value: string)

A set of user-defined (key, value) data that provides additional information about the log entry.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

operation

object(LogEntryOperation)

Optional. Information about an operation associated with the log entry, if applicable.

Union field payload. The log entry payload, which can be one of multiple types. payload can be only one of the following:
protoPayload

object

The log entry payload, represented as a protocol buffer that is expressed as a JSON object. The only accepted type currently is AuditLog.

An object containing fields of an arbitrary type. An additional field "@type" contains a URI identifying the type. Example: { "id": 1234, "@type": "types.example.com/standard/id" }.

textPayload

string

The log entry payload, represented as a Unicode string (UTF-8).

structPayload

object (Struct format)

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": number,
  "responseSize": string,
  "userAgent": string,
  "remoteIp": string,
  "serverIp": string,
  "referer": string,
  "latency": string,
  "cacheLookup": boolean,
  "cacheHit": boolean,
  "cacheValidatedWithOriginServer": boolean,
  "cacheFillBytes": string,
  "protocol": string
}
Fields
requestMethod

string

The request method. Examples: "GET", "HEAD", "PUT", "POST".

requestUrl

string

The scheme (http, https), the host name, the path, and the query portion of the URL that was requested. Example: "http://example.com/some/info?color=red".

requestSize

string (int64 format)

The size of the HTTP request message in bytes, including the request headers and the request body.

status

number

The response code indicating the status of the response. Examples: 200, 404.

responseSize

string (int64 format)

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

userAgent

string

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

remoteIp

string

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

serverIp

string

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

referer

string

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

latency

string (Duration format)

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 's'. Example: "3.5s".

cacheLookup

boolean

Whether or not a cache lookup was attempted.

cacheHit

boolean

Whether or not an entity was served from cache (with or without validation).

cacheValidatedWithOriginServer

boolean

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cacheHit is True.

cacheFillBytes

string (int64 format)

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

protocol

string

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

string

Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.

producer

string

Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication".

first

boolean

Optional. Set this to True if this is the first log entry in the operation.

last

boolean

Optional. Set this to True if this is the last log entry in the operation.

Importance

Defines the importance of the data contained in the operation.

Enums
LOW The API implementation may cache and aggregate the data. The data may be lost when rare and unexpected system failures occur.
HIGH The API implementation doesn't cache and aggregate the data. If the method returns successfully, it's guaranteed that the data has been persisted in durable storage.
هل كانت هذه الصفحة مفيدة؟ يرجى تقييم أدائنا:

إرسال تعليقات حول...

Service Infrastructure