Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New component: googlecloudlogentryencodingextension #37531

Open
alexvanboxel opened this issue Jan 28, 2025 · 3 comments
Open

New component: googlecloudlogentryencodingextension #37531

alexvanboxel opened this issue Jan 28, 2025 · 3 comments
Labels
Accepted Component New component has been sponsored

Comments

@alexvanboxel
Copy link
Contributor

alexvanboxel commented Jan 28, 2025

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 default json parses it as standard JSON, while text 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 default json parses it as standard JSON, while proto will use the well known protobuf types used in a
    LogEntry providing a better type handling, but sacrificing stability. Using text 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)

@atoulme

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.

@alexvanboxel
Copy link
Contributor Author

@atoulme
Copy link
Contributor

atoulme commented Jan 29, 2025

I can sponsor this component

@atoulme atoulme added Accepted Component New component has been sponsored and removed Sponsor Needed New component seeking sponsor needs triage New item requiring triage labels Jan 29, 2025
@alexvanboxel
Copy link
Contributor Author

I can sponsor this component

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Component New component has been sponsored
Projects
None yet
Development

No branches or pull requests

2 participants