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

Add Google Pubsub receiver for OTLP messages - PR1 #3552

Conversation

alexvanboxel
Copy link
Contributor

Description:
Add the skeleton for Google Pubsub receiver for OTLP messages. The export is able to read OTEP messages to a Google Pubsub subscription.

This receiver is the 2nd rewrite following feedback from the community on the original PR ( #1892 ), and also implements feedback given in the OTLP/Messaging otep:
open-telemetry/oteps#157

PR1 as described in the CONTRIBUTING guide only the README, config, and factory.

Link to tracking Issue:
#1802

Testing:
Tests for config and factory

Documentation:
Up-to-date README

@alexvanboxel alexvanboxel requested a review from a team as a code owner May 26, 2021 21:58
@project-bot project-bot bot added this to In progress in Collector May 26, 2021
@alexvanboxel alexvanboxel force-pushed the feature/googlecloudpubsubreceiver-pr1 branch 4 times, most recently from ba0075f to 80bf1cf Compare May 29, 2021 11:12
@alexvanboxel
Copy link
Contributor Author

Rebased, squached and added me to code owners, and added ependabot. /cc @punya @dashpole @bogdandrutu

@alexvanboxel
Copy link
Contributor Author

Comments about community module added (but for receiver), note that following the guidelines the implementation and the switch are upcoming
/cc @punya @bogdandrutu

receiver/googlecloudpubsubreceiver/README.md Outdated Show resolved Hide resolved
receiver/googlecloudpubsubreceiver/README.md Outdated Show resolved Hide resolved
receiver/googlecloudpubsubreceiver/README.md Outdated Show resolved Hide resolved
case "":
case "otlp_proto_trace":
default:
return fmt.Errorf("log format should be either otlp_proto, raw_string or raw_json")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this error message. Is the assumption that if a non-OTLP format is specified for traces that it must have been intended for logs? raw_string and raw_json wouldn't be valid here, would they?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error message corrected

@punya
Copy link
Member

punya commented Jun 2, 2021

How is this PR different from #3551? The code looks very similar, and I don't want to waste your time by duplicating comments.

@alexvanboxel
Copy link
Contributor Author

How is this PR different from #3551? The code looks very similar, and I don't want to waste your time by duplicating comments.

This is the receiver, as this is the mandatory PR1 (as mandated for new modules) they look similar. Implementation is very different of course (but that comes later).

@alexvanboxel alexvanboxel force-pushed the feature/googlecloudpubsubreceiver-pr1 branch from b0e357a to 7e4963e Compare June 2, 2021 22:11
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 10, 2021
@alexvanboxel alexvanboxel force-pushed the feature/googlecloudpubsubreceiver-pr1 branch from 7e4963e to 189ce50 Compare June 11, 2021 12:43
@alexvanboxel
Copy link
Contributor Author

Rebased to the latest main and squashed everything as a lot of changes were required. I think all concerns in the comments are addressed.

@github-actions github-actions bot removed the Stale label Jun 12, 2021
@alexvanboxel alexvanboxel force-pushed the feature/googlecloudpubsubreceiver-pr1 branch 2 times, most recently from ed9cc7d to f26cb19 Compare June 14, 2021 11:54
@alexvanboxel alexvanboxel force-pushed the feature/googlecloudpubsubreceiver-pr1 branch from f26cb19 to 53b1419 Compare June 14, 2021 14:10
@alexvanboxel
Copy link
Contributor Author

@bogdandrutu can you also approve the receiver part?

@alexvanboxel
Copy link
Contributor Author

Can someone approve this, @bogdandrutu approved the exporter ( #3551 ). This PR is blocking me to go to phase 2 of merging the actual implementation.

@aabmass
Copy link
Member

aabmass commented Jun 16, 2021

Should the title of this PR be "PR2" since #3551 is "PR1"?

@tigrannajaryan
Copy link
Member

@Aneurysm9 you already reviewed this, PTAL.

@alexvanboxel
Copy link
Contributor Author

alexvanboxel commented Jun 16, 2021

This is the receiver: receiver!, not the exporter, (the exporter is already merged), all are PR1 base boilerplate commits.

Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add godoc for exported functions and methods with the next PR.

receiver/googlecloudpubsubreceiver/config.go Outdated Show resolved Hide resolved
Collector automation moved this from In progress to Reviewer approved Jun 18, 2021
@alexvanboxel
Copy link
Contributor Author

Please add godoc for exported functions and methods with the next PR.

I will, thanks

@alexvanboxel
Copy link
Contributor Author

@Aneurysm9 can you press the merge button? I'm not authorized todo so.

@bogdandrutu bogdandrutu merged commit 1542471 into open-telemetry:main Jun 21, 2021
Collector automation moved this from Reviewer approved to Done Jun 21, 2021
@@ -0,0 +1,63 @@
# Google Pubsub Receiver
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Alexvanboxel, nice to meet you! I'm a member of the Cloud Trace team at Google.

Cloud Trace supports the single receiver approach, with one caveat. Our public documentation will still instruct customers to create one PubSub topic per telemetry type. The multi-topic approach allows for a more fine-grained authorization model (whereby Trace can only publish to the trace topic, Logging can only publish to the logging topic, and so on). However, this shouldn't affect your implementation. You can still write a single receiver that has the ability to accept all telemetry types. Our public documentation can simply encourage "best" security practices. There would be no inherent technical limitation that would prevent the customer from ignoring our documentation and piping all telemetry types through a single PubSub topic anyways.

We also favor this CloudEvents approach (as opposed to the OneOf() approach discussed in PR #157), implemented as Pub/Sub attributes. Our reasoning is that customers should be able to filter by telemetry type using message attributes before needing to deserialize the message.

One question I had, though, is your reasoning for using the CloudEvents spec? I'm unfamiliar with the spec, but reading through it, it appears rather thorough. Is the expectation that the receiver (and Trace, the publisher) will be fully compliant with the spec? And if not, and we are only using portions of it for inspiration, then does it make sense to give the PubSub attributes more familiar names such as (just as an example):

Finally, I wanted to thank you for your contributions! Let me know if you have any other questions for the Trace team.

Thanks,
Matt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, Matt: it's maybe worth having a meeting, last time I had a meeting with "Eyamba Ita" there was no mention on OTLP over Pubsub. You can mail me at "alex.vanboxel", at the company I work for "collibra.com". <- email spam bot proof

mstumpfx pushed a commit to mstumpfx/opentelemetry-collector-contrib that referenced this pull request Aug 31, 2021
* Add Google Pubsub receiver for OTLP messages

* Update receiver/googlecloudpubsubreceiver/config.go

Co-authored-by: Anthony Mirabella <[email protected]>

Co-authored-by: Anthony Mirabella <[email protected]>
@alexvanboxel alexvanboxel deleted the feature/googlecloudpubsubreceiver-pr1 branch November 16, 2023 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Collector
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants