Description
The purpose and use-cases of the new component
This extension can be used fo unmarshaling a Cloud Logging LogEntry message type.
The following configuration options are supported:
handle_json_payload_as
(Optional): This controls how the json payload of the LogEntry is parsed into the body.
The defaultjson
parses it as standard JSON, whiletext
will the put the payload as a single string.handle_proto_payload_as
(Optional): This controls how the json payload of the LogEntry is parsed into the body.
The defaultjson
parses it as standard JSON, whileproto
will use the well known protobuf types used in a
LogEntry providing a better type handling, but sacrificing stability. Usingtext
will the put the payload as a
single string.
The encoding is mainly used in conjunction with the googlecloudpubsubreceiver
. The receiver can be used to bring
Cloud Logging messages into an OpenTelemetry pipeline. You'll first need to set up a logging sink with
a Pub/Sub topic as its destination. This encoder can be configure to parse the LogEntry. An example config
could look like this:
extensions:
googlecloudlogentry_encoding:
handle_json_payload_as: "json"
handle_proto_payload_as: "json"
receivers:
googlecloudpubsub:
project: otel-project
subscription: projects/otel-project/subscriptions/otlp-logs
encoding: googlecloudlogentry_encoding
Example configuration for the component
googlecloudlogentry_encoding:
handle_json_payload_as: "json"
handle_proto_payload_as: "json"
receivers:
googlecloudpubsub:
project: otel-project
subscription: projects/otel-project/subscriptions/otlp-logs
encoding: googlecloudlogentry_encoding
Telemetry data types supported
logs
Code Owner(s)
alexvanboxel
Sponsor (optional)
Additional context
This encoder is currently part of the googlecloudpubsubreceiver
. The main goal to extract this is that this component can have an alpha stability (due to the changing semantic conventions), and the googlepubsubreceiver
and googlepubsubexporter
reach GA stability.
The googlepubsubreceiver
now support encoding extensions.