You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify the mapping between Google Cloud Logging and OpenTelemetry
* Clarify that the JSON representation is used for the LogEntry
* Change to Pascal-case for representing the field in LogEntry
* Map MonitoredResource to resource attributes with gcp prefix
* Clarify the type of the Body for jsonPayload, protoPayload, and textPayload
* Mapping section for Severity from Cloud Logging to OpenTelemetry
* Mapping section for Severity from OpenTelemetry to Cloud Logging
* Semantic Mapping section (only includes log.record.uid)
* Clarified that the JSON representation is used for the LogEntry
* Map LogEntryOperation to resource attribute with gcp.operation (KVList)
* Map LogEntrySourceLocation to resource attribute with gcp.source_location (KVList)
* Map LogSplit to resource attribute with gcp.log_split (KVList)
With this [draft collector PR](open-telemetry/opentelemetry-collector-contrib#29299),
the PubsubReceiver will be able to handle the native translation of Google Cloud LogEntry's.
But translations are opinionated. I prefer that we agree on the target mapping before merging
the PR.
timestamp | string | The time the event described by the log entry occurred. | Timestamp
488
-
resource | MonitoredResource | The monitored resource that produced this log entry. | Resource
489
-
log_name | string | The URL-encoded LOG_ID suffix of the log_name field identifies which log stream this entry belongs to. | Attributes["gcp.log_name"]
490
-
json_payload | google.protobuf.Struct | The log entry payload, represented as a structure that is expressed as a JSON object. | Body
491
-
proto_payload | google.protobuf.Any | The log entry payload, represented as a protocol buffer. | Body
492
-
text_payload | string | The log entry payload, represented as a Unicode string (UTF-8). | Body
493
-
severity | LogSeverity | The severity of the log entry. | Severity
494
-
trace | string | The trace associated with the log entry, if any. | TraceId
495
-
span_id | string | The span ID within the trace associated with the log entry. | SpanId
496
-
labels | map<string,string> | A set of user-defined (key, value) data that provides additional information about the log entry. | Attributes
497
-
http_request | HttpRequest | The HTTP request associated with the log entry, if any. | Attributes["gcp.http_request"]
498
-
trace_sampled | boolean | The sampling decision of the trace associated with the log entry. | TraceFlags.SAMPLED
499
-
All other fields | | | Attributes["gcp.*"]
488
+
Google Cloud logging uses the [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) to
489
+
cary log information. In this section the JSON representation is used for mapping of the fields to OpenTelemetry fields
490
+
and attributes.
491
+
492
+
#### Semantic Mapping
493
+
494
+
Some of the attributes can be moved to OpenTelemetry Semantic Conventions.
495
+
496
+
| Field | Type | Description | Maps to Unified Model Field |
|`timestamp`|`string`| The time the event described by the log entry occurred. |`Timestamp`|
537
+
|`receiveTimestamp`|`string`| The time the log entry was received. |`ObservedTimestamp`|
538
+
|`logName`|`string`| The URL-encoded log ID suffix of the log_name field identifies which log stream this entry belongs to. |`Attributes["gcp.log_name"]` (string) |
539
+
|`jsonPayload`|`google.protobuf.Struct`| The log entry payload, represented as a structure that is expressed as a JSON object. |`Body` (KVList) |
540
+
|`protoPayload`|`google.protobuf.Any`| The log entry payload, represented as a protocol buffer. |`Body` (KVList, key from JSON representation) |
541
+
|`textPayload`|`string`| The log entry payload, represented as a Unicode string (UTF-8). |`Body` (string) |
542
+
|`trace`|`string`| The trace associated with the log entry, if any. |`TraceId`|
543
+
|`spanId`|`string`| The span ID within the trace associated with the log entry. |`SpanId`|
544
+
|`traceSampled`|`boolean`| The sampling decision of the trace associated with the log entry. |`TraceFlags.SAMPLED`|
545
+
|`labels`|`map<string,string>`| A set of user-defined (key, value) data that provides additional information about the log entry. |`Attributes`|
546
+
|`resource`|`MonitoredResource`| The monitored resource that produced this log entry. |`Resource["gcp.*"]`|
547
+
|`httpRequest`|`HttpRequest`| The HTTP request associated with the log entry, if any. |`Attributes["gcp.http_request"]` (KVList) |
548
+
|`operation`|`LogEntryOperation`| Information about a operation associated with the log entry. |`Attributes["gcp.operation"]` (KVList) |
549
+
|`sourceLocation`|`LogEntrySourceLocation`| Source code location information associated with the log entry. |`Attributes["gcp.source_location"]` (KVList) |
550
+
|`split`|`LogSplit`| Information indicating this LogEntry is part of a sequence of multiple log entries split from a single LogEntry. |`Attributes["gcp.log_split"]` (KVList) |
0 commit comments