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

Supported json encoded messages in googlecloudpubsub exporter #33156

Open
brandonbirdj opened this issue May 21, 2024 · 2 comments
Open

Supported json encoded messages in googlecloudpubsub exporter #33156

brandonbirdj opened this issue May 21, 2024 · 2 comments
Labels

Comments

@brandonbirdj
Copy link

Component(s)

exporter/googlecloudpubsub

Is your feature request related to a problem? Please describe.

Many of the out of the box ways to get logs into pubsub from google cloud utilize jsonPayload, and json encoding. One example is when configuring a log sink from Google Cloud Logging.

In order to make it easier to have a drop in replacement it would be very useful to also support json encoded messages. Putting the message body inside a field called jsonPayload could simple be done in the log pipeline of the collector, no exporter changes needed.

Additionally I think there is perhaps an opportunity to make the attributes set a little more dynamic as opposed to the current cloud events ones.

Describe the solution you'd like

It would be useful to perhaps allow a user to supply additonal attributes. I do not presently have a usecase for this, and would also be happy to just not use the cloud events ones if json encoding is provided.

exporters:
  googlecloudpubsub:
    project: abc
    endpoint: mytestendpoint
    user_agent: projects/abc/topics/requests
    additional_attributes:
    - version
    encoding: json

Describe alternatives you've considered

Forking this provider, or converting all other dependent logic presently relying on json encoding are the only alternatives I have considered.

Additional context

I would be happy to help write this, but would like direction on how to handle the additional attributes and what to do with the current ce ones.

@brandonbirdj brandonbirdj added enhancement New feature or request needs triage New item requiring triage labels May 21, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@alexvanboxel
Copy link
Contributor

Please extract the attribute issue in another issue, so the discussion can be decoppeled.

I'm willing to accept contributions for JSON encoding only if its the standard encoded pdata in JSON format provided by the marshallers in the collector itself (this means it MUST NOT be wrapped in an jsonPayload and the encoding needs to be added to the ce-content-encoding field. Ideally, the JSON encoding SHOULD be added to the receiver. The receiver and exporter are a duo.

@crobert-1 crobert-1 removed the needs triage New item requiring triage label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants