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

Closed
brandonbirdj opened this issue May 21, 2024 · 5 comments
Closed

Supported json encoded messages in googlecloudpubsub exporter #33156

brandonbirdj opened this issue May 21, 2024 · 5 comments

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
@brandonbirdj
Copy link
Author

brandonbirdj commented Jun 21, 2024

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.

@alexvanboxel to clarify what you said you are saying the receiver should not use "raw_json" encoding, but rather detect from the payload? Similarly the exporter will auto detect, so neither will have a config option making it required to set?

Specifically I'm confused by the following comment since the receiver can support raw_json

the JSON encoding SHOULD be added to the receiver. The receiver and exporter are a duo.

Since cloud events supports json perhaps simply allowing auto detection and use of"content-type": "application/cloudevents+json; charset=UTF-8" would be simpler?
https://github.com/google/knative-gcp/blob/main/docs/spec/pubsub-protocol-binding.md#22-data-attribute

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

@github-actions github-actions bot added the Stale label Aug 21, 2024
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants