@google-cloud/logging-api 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +111 -0
  2. package/build/protos/google/logging/type/http_request.proto +95 -0
  3. package/build/protos/google/logging/type/log_severity.proto +71 -0
  4. package/build/protos/google/logging/v2/log_entry.proto +280 -0
  5. package/build/protos/google/logging/v2/logging.proto +483 -0
  6. package/build/protos/google/logging/v2/logging_config.proto +2317 -0
  7. package/build/protos/google/logging/v2/logging_metrics.proto +339 -0
  8. package/build/protos/protos.d.ts +19677 -0
  9. package/build/protos/protos.js +1 -0
  10. package/build/protos/protos.json +1 -0
  11. package/build/src/index.d.ts +17 -0
  12. package/build/src/index.js +32 -0
  13. package/build/src/index.js.map +1 -0
  14. package/build/src/v2/config_service_v2_client.d.ts +2879 -0
  15. package/build/src/v2/config_service_v2_client.js +3801 -0
  16. package/build/src/v2/config_service_v2_client.js.map +1 -0
  17. package/build/src/v2/config_service_v2_client_config.json +169 -0
  18. package/build/src/v2/config_service_v2_proto_list.json +8 -0
  19. package/build/src/v2/gapic_metadata.json +512 -0
  20. package/build/src/v2/index.d.ts +3 -0
  21. package/build/src/v2/index.js +27 -0
  22. package/build/src/v2/index.js.map +1 -0
  23. package/build/src/v2/logging_service_v2_client.d.ts +1617 -0
  24. package/build/src/v2/logging_service_v2_client.js +2177 -0
  25. package/build/src/v2/logging_service_v2_client.js.map +1 -0
  26. package/build/src/v2/logging_service_v2_client_config.json +61 -0
  27. package/build/src/v2/logging_service_v2_proto_list.json +8 -0
  28. package/build/src/v2/metrics_service_v2_client.d.ts +1249 -0
  29. package/build/src/v2/metrics_service_v2_client.js +1911 -0
  30. package/build/src/v2/metrics_service_v2_client.js.map +1 -0
  31. package/build/src/v2/metrics_service_v2_client_config.json +56 -0
  32. package/build/src/v2/metrics_service_v2_proto_list.json +8 -0
  33. package/package.json +67 -0
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."
2
+ [//]: # "The comments you see below are used to generate those parts of the template in later states."
3
+ <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
4
+
5
+ # [Cloud Logging API: Nodejs Client][homepage]
6
+
7
+ > [!IMPORTANT]
8
+ > **Internal API Client**: This library (`@google-cloud/logging-api`) is an auto-generated, lightweight GAPIC layer designed as a dependency for the official handwritten client library. End users should install and import **[@google-cloud/logging](https://www.npmjs.com/package/@google-cloud/logging)** instead.
9
+
10
+ [//]: # "releaseLevel"
11
+
12
+ [![npm version](https://img.shields.io/npm/v/@google-cloud/logging-api.svg)](https://www.npmjs.org/package/@google-cloud/logging-api)
13
+
14
+ Cloud Logging API client for Node.js
15
+
16
+ [//]: # "partials.introduction"
17
+
18
+ A comprehensive list of changes in each version may be found in
19
+ [the CHANGELOG][homepage_changelog].
20
+
21
+ * [Cloud Logging API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/logging/latest)
22
+ * [Cloud Logging API Documentation](https://cloud.google.com/logging/docs/)
23
+
24
+ Read more about the client libraries for Cloud APIs, including the older
25
+ Google APIs Client Libraries, in [Client Libraries Explained][explained].
26
+
27
+ [explained]: https://cloud.google.com/apis/docs/client-libraries-explained
28
+
29
+ **Table of contents:**
30
+
31
+ * [Quickstart](#quickstart)
32
+ * [Before you begin](#before-you-begin)
33
+ * [Installing the client library](#installing-the-client-library)
34
+
35
+ * [Versioning](#versioning)
36
+ * [Contributing](#contributing)
37
+ * [License](#license)
38
+
39
+ ## Quickstart
40
+ ### Before you begin
41
+
42
+ 1. [Select or create a Cloud Platform project][projects].
43
+ 1. [Enable billing for your project][billing].
44
+ 1. [Enable the Cloud Logging API API][enable_api].
45
+ 1. [Set up authentication][auth] so you can access the
46
+ API from your local workstation.
47
+ ### Installing the client library
48
+
49
+ ```bash
50
+ npm install @google-cloud/logging-api
51
+ ```
52
+
53
+ [//]: # "partials.body"
54
+
55
+ ## Samples
56
+
57
+ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample.
58
+
59
+ [//]: # "samples"
60
+
61
+ ## Supported Node.js Versions
62
+
63
+ Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule).
64
+ Libraries are compatible with all current _active_ and _maintenance_ versions of
65
+ Node.js.
66
+ If you are using an end-of-life version of Node.js, we recommend that you update
67
+ as soon as possible to an actively supported LTS version.
68
+
69
+ Google's client libraries support legacy versions of Node.js runtimes on a
70
+ best-efforts basis with the following warnings:
71
+
72
+ * Legacy versions are not tested in continuous integration.
73
+ * Some security patches and features cannot be backported.
74
+ * Dependencies cannot be kept up-to-date.
75
+
76
+ Client libraries targeting some end-of-life versions of Node.js are available, and
77
+ can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
78
+ The dist-tags follow the naming convention `legacy-(version)`.
79
+ For example, `npm install @google-cloud/logging-api@legacy-8` installs client libraries
80
+ for versions compatible with Node.js 8.
81
+
82
+ ## Versioning
83
+
84
+ This library follows [Semantic Versioning](http://semver.org/).
85
+
86
+ More Information: [Google Cloud Platform Launch Stages][launch_stages]
87
+
88
+ [launch_stages]: https://cloud.google.com/terms/launch-stages
89
+
90
+ ## Contributing
91
+
92
+ Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md).
93
+
94
+ Please note that this `README.md`
95
+ and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
96
+ are generated from a central template.
97
+
98
+ ## License
99
+
100
+ Apache Version 2.0
101
+
102
+ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
103
+
104
+ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
105
+ [projects]: https://console.cloud.google.com/project
106
+ [billing]: https://support.google.com/cloud/answer/6293499#enable-billing
107
+ [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=logging.googleapis.com
108
+ [auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
109
+ [homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-logging-api/samples
110
+ [homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-logging-api/CHANGELOG.md
111
+ [homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-logging-api
@@ -0,0 +1,95 @@
1
+ // Copyright 2025 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.logging.type;
18
+
19
+ import "google/protobuf/duration.proto";
20
+
21
+ option csharp_namespace = "Google.Cloud.Logging.Type";
22
+ option go_package = "google.golang.org/genproto/googleapis/logging/type;ltype";
23
+ option java_multiple_files = true;
24
+ option java_outer_classname = "HttpRequestProto";
25
+ option java_package = "com.google.logging.type";
26
+ option php_namespace = "Google\\Cloud\\Logging\\Type";
27
+ option ruby_package = "Google::Cloud::Logging::Type";
28
+
29
+ // A common proto for logging HTTP requests. Only contains semantics
30
+ // defined by the HTTP specification. Product-specific logging
31
+ // information MUST be defined in a separate message.
32
+ message HttpRequest {
33
+ // The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
34
+ string request_method = 1;
35
+
36
+ // The scheme (http, https), the host name, the path and the query
37
+ // portion of the URL that was requested.
38
+ // Example: `"http://example.com/some/info?color=red"`.
39
+ string request_url = 2;
40
+
41
+ // The size of the HTTP request message in bytes, including the request
42
+ // headers and the request body.
43
+ int64 request_size = 3;
44
+
45
+ // The response code indicating the status of response.
46
+ // Examples: 200, 404.
47
+ int32 status = 4;
48
+
49
+ // The size of the HTTP response message sent back to the client, in bytes,
50
+ // including the response headers and the response body.
51
+ int64 response_size = 5;
52
+
53
+ // The user agent sent by the client. Example:
54
+ // `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
55
+ // CLR 1.0.3705)"`.
56
+ string user_agent = 6;
57
+
58
+ // The IP address (IPv4 or IPv6) of the client that issued the HTTP
59
+ // request. This field can include port information. Examples:
60
+ // `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
61
+ string remote_ip = 7;
62
+
63
+ // The IP address (IPv4 or IPv6) of the origin server that the request was
64
+ // sent to. This field can include port information. Examples:
65
+ // `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
66
+ string server_ip = 13;
67
+
68
+ // The referer URL of the request, as defined in
69
+ // [HTTP/1.1 Header Field
70
+ // Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
71
+ string referer = 8;
72
+
73
+ // The request processing latency on the server, from the time the request was
74
+ // received until the response was sent.
75
+ google.protobuf.Duration latency = 14;
76
+
77
+ // Whether or not a cache lookup was attempted.
78
+ bool cache_lookup = 11;
79
+
80
+ // Whether or not an entity was served from cache
81
+ // (with or without validation).
82
+ bool cache_hit = 9;
83
+
84
+ // Whether or not the response was validated with the origin server before
85
+ // being served from cache. This field is only meaningful if `cache_hit` is
86
+ // True.
87
+ bool cache_validated_with_origin_server = 10;
88
+
89
+ // The number of HTTP response bytes inserted into cache. Set only when a
90
+ // cache fill was attempted.
91
+ int64 cache_fill_bytes = 12;
92
+
93
+ // Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
94
+ string protocol = 15;
95
+ }
@@ -0,0 +1,71 @@
1
+ // Copyright 2025 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.logging.type;
18
+
19
+ option csharp_namespace = "Google.Cloud.Logging.Type";
20
+ option go_package = "google.golang.org/genproto/googleapis/logging/type;ltype";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "LogSeverityProto";
23
+ option java_package = "com.google.logging.type";
24
+ option objc_class_prefix = "GLOG";
25
+ option php_namespace = "Google\\Cloud\\Logging\\Type";
26
+ option ruby_package = "Google::Cloud::Logging::Type";
27
+
28
+ // The severity of the event described in a log entry, expressed as one of the
29
+ // standard severity levels listed below. For your reference, the levels are
30
+ // assigned the listed numeric values. The effect of using numeric values other
31
+ // than those listed is undefined.
32
+ //
33
+ // You can filter for log entries by severity. For example, the following
34
+ // filter expression will match log entries with severities `INFO`, `NOTICE`,
35
+ // and `WARNING`:
36
+ //
37
+ // severity > DEBUG AND severity <= WARNING
38
+ //
39
+ // If you are writing log entries, you should map other severity encodings to
40
+ // one of these standard levels. For example, you might map all of Java's FINE,
41
+ // FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the
42
+ // original severity level in the log entry payload if you wish.
43
+ enum LogSeverity {
44
+ // (0) The log entry has no assigned severity level.
45
+ DEFAULT = 0;
46
+
47
+ // (100) Debug or trace information.
48
+ DEBUG = 100;
49
+
50
+ // (200) Routine information, such as ongoing status or performance.
51
+ INFO = 200;
52
+
53
+ // (300) Normal but significant events, such as start up, shut down, or
54
+ // a configuration change.
55
+ NOTICE = 300;
56
+
57
+ // (400) Warning events might cause problems.
58
+ WARNING = 400;
59
+
60
+ // (500) Error events are likely to cause problems.
61
+ ERROR = 500;
62
+
63
+ // (600) Critical events cause more severe problems or outages.
64
+ CRITICAL = 600;
65
+
66
+ // (700) A person must take an action immediately.
67
+ ALERT = 700;
68
+
69
+ // (800) One or more systems are unusable.
70
+ EMERGENCY = 800;
71
+ }
@@ -0,0 +1,280 @@
1
+ // Copyright 2025 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.logging.v2;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/monitored_resource.proto";
21
+ import "google/api/resource.proto";
22
+ import "google/logging/type/http_request.proto";
23
+ import "google/logging/type/log_severity.proto";
24
+ import "google/protobuf/any.proto";
25
+ import "google/protobuf/struct.proto";
26
+ import "google/protobuf/timestamp.proto";
27
+
28
+ option cc_enable_arenas = true;
29
+ option csharp_namespace = "Google.Cloud.Logging.V2";
30
+ option go_package = "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb";
31
+ option java_multiple_files = true;
32
+ option java_outer_classname = "LogEntryProto";
33
+ option java_package = "com.google.logging.v2";
34
+ option php_namespace = "Google\\Cloud\\Logging\\V2";
35
+ option ruby_package = "Google::Cloud::Logging::V2";
36
+
37
+ // An individual entry in a log.
38
+ message LogEntry {
39
+ option (google.api.resource) = {
40
+ type: "logging.googleapis.com/Log"
41
+ pattern: "projects/{project}/logs/{log}"
42
+ pattern: "organizations/{organization}/logs/{log}"
43
+ pattern: "folders/{folder}/logs/{log}"
44
+ pattern: "billingAccounts/{billing_account}/logs/{log}"
45
+ name_field: "log_name"
46
+ };
47
+
48
+ // Required. The resource name of the log to which this log entry belongs:
49
+ //
50
+ // "projects/[PROJECT_ID]/logs/[LOG_ID]"
51
+ // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
52
+ // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
53
+ // "folders/[FOLDER_ID]/logs/[LOG_ID]"
54
+ //
55
+ // A project number may be used in place of PROJECT_ID. The project number is
56
+ // translated to its corresponding PROJECT_ID internally and the `log_name`
57
+ // field will contain PROJECT_ID in queries and exports.
58
+ //
59
+ // `[LOG_ID]` must be URL-encoded within `log_name`. Example:
60
+ // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
61
+ //
62
+ // `[LOG_ID]` must be less than 512 characters long and can only include the
63
+ // following characters: upper and lower case alphanumeric characters,
64
+ // forward-slash, underscore, hyphen, and period.
65
+ //
66
+ // For backward compatibility, if `log_name` begins with a forward-slash, such
67
+ // as `/projects/...`, then the log entry is ingested as usual, but the
68
+ // forward-slash is removed. Listing the log entry will not show the leading
69
+ // slash and filtering for a log name with a leading slash will never return
70
+ // any results.
71
+ string log_name = 12 [(google.api.field_behavior) = REQUIRED];
72
+
73
+ // Required. The monitored resource that produced this log entry.
74
+ //
75
+ // Example: a log entry that reports a database error would be associated with
76
+ // the monitored resource designating the particular database that reported
77
+ // the error.
78
+ google.api.MonitoredResource resource = 8
79
+ [(google.api.field_behavior) = REQUIRED];
80
+
81
+ // The log entry payload, which can be one of multiple types.
82
+ oneof payload {
83
+ // The log entry payload, represented as a protocol buffer. Some Google
84
+ // Cloud Platform services use this field for their log entry payloads.
85
+ //
86
+ // The following protocol buffer types are supported; user-defined types
87
+ // are not supported:
88
+ //
89
+ // "type.googleapis.com/google.cloud.audit.AuditLog"
90
+ // "type.googleapis.com/google.appengine.logging.v1.RequestLog"
91
+ google.protobuf.Any proto_payload = 2;
92
+
93
+ // The log entry payload, represented as a Unicode string (UTF-8).
94
+ string text_payload = 3;
95
+
96
+ // The log entry payload, represented as a structure that is
97
+ // expressed as a JSON object.
98
+ google.protobuf.Struct json_payload = 6;
99
+ }
100
+
101
+ // Optional. The time the event described by the log entry occurred. This time
102
+ // is used to compute the log entry's age and to enforce the logs retention
103
+ // period. If this field is omitted in a new log entry, then Logging assigns
104
+ // it the current time. Timestamps have nanosecond accuracy, but trailing
105
+ // zeros in the fractional seconds might be omitted when the timestamp is
106
+ // displayed.
107
+ //
108
+ // Incoming log entries must have timestamps that don't exceed the
109
+ // [logs retention
110
+ // period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
111
+ // the past, and that don't exceed 24 hours in the future. Log entries outside
112
+ // those time boundaries aren't ingested by Logging.
113
+ google.protobuf.Timestamp timestamp = 9
114
+ [(google.api.field_behavior) = OPTIONAL];
115
+
116
+ // Output only. The time the log entry was received by Logging.
117
+ google.protobuf.Timestamp receive_timestamp = 24
118
+ [(google.api.field_behavior) = OUTPUT_ONLY];
119
+
120
+ // Optional. The severity of the log entry. The default value is
121
+ // `LogSeverity.DEFAULT`.
122
+ google.logging.type.LogSeverity severity = 10
123
+ [(google.api.field_behavior) = OPTIONAL];
124
+
125
+ // Optional. A unique identifier for the log entry. If you provide a value,
126
+ // then Logging considers other log entries in the same project, with the same
127
+ // `timestamp`, and with the same `insert_id` to be duplicates which are
128
+ // removed in a single query result. However, there are no guarantees of
129
+ // de-duplication in the export of logs.
130
+ //
131
+ // If the `insert_id` is omitted when writing a log entry, the Logging API
132
+ // assigns its own unique identifier in this field.
133
+ //
134
+ // In queries, the `insert_id` is also used to order log entries that have
135
+ // the same `log_name` and `timestamp` values.
136
+ string insert_id = 4 [(google.api.field_behavior) = OPTIONAL];
137
+
138
+ // Optional. Information about the HTTP request associated with this log
139
+ // entry, if applicable.
140
+ google.logging.type.HttpRequest http_request = 7
141
+ [(google.api.field_behavior) = OPTIONAL];
142
+
143
+ // Optional. A map of key, value pairs that provides additional information
144
+ // about the log entry. The labels can be user-defined or system-defined.
145
+ //
146
+ // User-defined labels are arbitrary key, value pairs that you can use to
147
+ // classify logs.
148
+ //
149
+ // System-defined labels are defined by GCP services for platform logs.
150
+ // They have two components - a service namespace component and the
151
+ // attribute name. For example: `compute.googleapis.com/resource_name`.
152
+ //
153
+ // Cloud Logging truncates label keys that exceed 512 B and label
154
+ // values that exceed 64 KB upon their associated log entry being
155
+ // written. The truncation is indicated by an ellipsis at the
156
+ // end of the character string.
157
+ map<string, string> labels = 11 [(google.api.field_behavior) = OPTIONAL];
158
+
159
+ // Optional. Information about an operation associated with the log entry, if
160
+ // applicable.
161
+ LogEntryOperation operation = 15 [(google.api.field_behavior) = OPTIONAL];
162
+
163
+ // Optional. The REST resource name of the trace being written to
164
+ // [Cloud Trace](https://cloud.google.com/trace) in
165
+ // association with this log entry. For example, if your trace data is stored
166
+ // in the Cloud project "my-trace-project" and if the service that is creating
167
+ // the log entry receives a trace header that includes the trace ID "12345",
168
+ // then the service should use "projects/my-tracing-project/traces/12345".
169
+ //
170
+ // The `trace` field provides the link between logs and traces. By using
171
+ // this field, you can navigate from a log entry to a trace.
172
+ string trace = 22 [(google.api.field_behavior) = OPTIONAL];
173
+
174
+ // Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
175
+ // associated with the current operation in which the log is being written.
176
+ // For example, if a span has the REST resource name of
177
+ // "projects/some-project/traces/some-trace/spans/some-span-id", then the
178
+ // `span_id` field is "some-span-id".
179
+ //
180
+ // A
181
+ // [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
182
+ // represents a single operation within a trace. Whereas a trace may involve
183
+ // multiple different microservices running on multiple different machines,
184
+ // a span generally corresponds to a single logical operation being performed
185
+ // in a single instance of a microservice on one specific machine. Spans
186
+ // are the nodes within the tree that is a trace.
187
+ //
188
+ // Applications that are [instrumented for
189
+ // tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
190
+ // new, unique span ID on each incoming request. It is also common to create
191
+ // and record additional spans corresponding to internal processing elements
192
+ // as well as issuing requests to dependencies.
193
+ //
194
+ // The span ID is expected to be a 16-character, hexadecimal encoding of an
195
+ // 8-byte array and should not be zero. It should be unique within the trace
196
+ // and should, ideally, be generated in a manner that is uniformly random.
197
+ //
198
+ // Example values:
199
+ //
200
+ // - `000000000000004a`
201
+ // - `7a2190356c3fc94b`
202
+ // - `0000f00300090021`
203
+ // - `d39223e101960076`
204
+ string span_id = 27 [(google.api.field_behavior) = OPTIONAL];
205
+
206
+ // Optional. The sampling decision of the trace associated with the log entry.
207
+ //
208
+ // True means that the trace resource name in the `trace` field was sampled
209
+ // for storage in a trace backend. False means that the trace was not sampled
210
+ // for storage when this log entry was written, or the sampling decision was
211
+ // unknown at the time. A non-sampled `trace` value is still useful as a
212
+ // request correlation identifier. The default is False.
213
+ bool trace_sampled = 30 [(google.api.field_behavior) = OPTIONAL];
214
+
215
+ // Optional. Source code location information associated with the log entry,
216
+ // if any.
217
+ LogEntrySourceLocation source_location = 23
218
+ [(google.api.field_behavior) = OPTIONAL];
219
+
220
+ // Optional. Information indicating this LogEntry is part of a sequence of
221
+ // multiple log entries split from a single LogEntry.
222
+ LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL];
223
+ }
224
+
225
+ // Additional information about a potentially long-running operation with which
226
+ // a log entry is associated.
227
+ message LogEntryOperation {
228
+ // Optional. An arbitrary operation identifier. Log entries with the same
229
+ // identifier are assumed to be part of the same operation.
230
+ string id = 1 [(google.api.field_behavior) = OPTIONAL];
231
+
232
+ // Optional. An arbitrary producer identifier. The combination of `id` and
233
+ // `producer` must be globally unique. Examples for `producer`:
234
+ // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
235
+ string producer = 2 [(google.api.field_behavior) = OPTIONAL];
236
+
237
+ // Optional. Set this to True if this is the first log entry in the operation.
238
+ bool first = 3 [(google.api.field_behavior) = OPTIONAL];
239
+
240
+ // Optional. Set this to True if this is the last log entry in the operation.
241
+ bool last = 4 [(google.api.field_behavior) = OPTIONAL];
242
+ }
243
+
244
+ // Additional information about the source code location that produced the log
245
+ // entry.
246
+ message LogEntrySourceLocation {
247
+ // Optional. Source file name. Depending on the runtime environment, this
248
+ // might be a simple name or a fully-qualified name.
249
+ string file = 1 [(google.api.field_behavior) = OPTIONAL];
250
+
251
+ // Optional. Line within the source file. 1-based; 0 indicates no line number
252
+ // available.
253
+ int64 line = 2 [(google.api.field_behavior) = OPTIONAL];
254
+
255
+ // Optional. Human-readable name of the function or method being invoked, with
256
+ // optional context such as the class or package name. This information may be
257
+ // used in contexts such as the logs viewer, where a file and line number are
258
+ // less meaningful. The format can vary by language. For example:
259
+ // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
260
+ // (Python).
261
+ string function = 3 [(google.api.field_behavior) = OPTIONAL];
262
+ }
263
+
264
+ // Additional information used to correlate multiple log entries. Used when a
265
+ // single LogEntry would exceed the Google Cloud Logging size limit and is
266
+ // split across multiple log entries.
267
+ message LogSplit {
268
+ // A globally unique identifier for all log entries in a sequence of split log
269
+ // entries. All log entries with the same |LogSplit.uid| are assumed to be
270
+ // part of the same sequence of split log entries.
271
+ string uid = 1;
272
+
273
+ // The index of this LogEntry in the sequence of split log entries. Log
274
+ // entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
275
+ // entries.
276
+ int32 index = 2;
277
+
278
+ // The total number of log entries that the original LogEntry was split into.
279
+ int32 total_splits = 3;
280
+ }