log_entry.proto 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.api.servicecontrol.v1;
  16. import "google/api/servicecontrol/v1/http_request.proto";
  17. import "google/logging/type/log_severity.proto";
  18. import "google/protobuf/any.proto";
  19. import "google/protobuf/struct.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.ServiceControl.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "LogEntryProto";
  25. option java_package = "com.google.api.servicecontrol.v1";
  26. option php_namespace = "Google\\Cloud\\ServiceControl\\V1";
  27. option ruby_package = "Google::Cloud::ServiceControl::V1";
  28. // An individual log entry.
  29. message LogEntry {
  30. // Required. The log to which this log entry belongs. Examples: `"syslog"`,
  31. // `"book_log"`.
  32. string name = 10;
  33. // The time the event described by the log entry occurred. If
  34. // omitted, defaults to operation start time.
  35. google.protobuf.Timestamp timestamp = 11;
  36. // The severity of the log entry. The default value is
  37. // `LogSeverity.DEFAULT`.
  38. google.logging.type.LogSeverity severity = 12;
  39. // Optional. Information about the HTTP request associated with this
  40. // log entry, if applicable.
  41. HttpRequest http_request = 14;
  42. // Optional. Resource name of the trace associated with the log entry, if any.
  43. // If this field contains a relative resource name, you can assume the name is
  44. // relative to `//tracing.googleapis.com`. Example:
  45. // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
  46. string trace = 15;
  47. // A unique ID for the log entry used for deduplication. If omitted,
  48. // the implementation will generate one based on operation_id.
  49. string insert_id = 4;
  50. // A set of user-defined (key, value) data that provides additional
  51. // information about the log entry.
  52. map<string, string> labels = 13;
  53. // The log entry payload, which can be one of multiple types.
  54. oneof payload {
  55. // The log entry payload, represented as a protocol buffer that is
  56. // expressed as a JSON object. The only accepted type currently is
  57. // [AuditLog][google.cloud.audit.AuditLog].
  58. google.protobuf.Any proto_payload = 2;
  59. // The log entry payload, represented as a Unicode string (UTF-8).
  60. string text_payload = 3;
  61. // The log entry payload, represented as a structure that
  62. // is expressed as a JSON object.
  63. google.protobuf.Struct struct_payload = 6;
  64. }
  65. // Optional. Information about an operation associated with the log entry, if
  66. // applicable.
  67. LogEntryOperation operation = 16;
  68. // Optional. Source code location information associated with the log entry,
  69. // if any.
  70. LogEntrySourceLocation source_location = 17;
  71. }
  72. // Additional information about a potentially long-running operation with which
  73. // a log entry is associated.
  74. message LogEntryOperation {
  75. // Optional. An arbitrary operation identifier. Log entries with the
  76. // same identifier are assumed to be part of the same operation.
  77. string id = 1;
  78. // Optional. An arbitrary producer identifier. The combination of
  79. // `id` and `producer` must be globally unique. Examples for `producer`:
  80. // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
  81. string producer = 2;
  82. // Optional. Set this to True if this is the first log entry in the operation.
  83. bool first = 3;
  84. // Optional. Set this to True if this is the last log entry in the operation.
  85. bool last = 4;
  86. }
  87. // Additional information about the source code location that produced the log
  88. // entry.
  89. message LogEntrySourceLocation {
  90. // Optional. Source file name. Depending on the runtime environment, this
  91. // might be a simple name or a fully-qualified name.
  92. string file = 1;
  93. // Optional. Line within the source file. 1-based; 0 indicates no line number
  94. // available.
  95. int64 line = 2;
  96. // Optional. Human-readable name of the function or method being invoked, with
  97. // optional context such as the class or package name. This information may be
  98. // used in contexts such as the logs viewer, where a file and line number are
  99. // less meaningful. The format can vary by language. For example:
  100. // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
  101. // (Python).
  102. string function = 3;
  103. }