Skip to content

[receiver/googlecloudpubsubpush] Add implementation#44101

Merged
songy23 merged 23 commits into
open-telemetry:mainfrom
constanca-m:googlecloudpubsub-implementation
Nov 19, 2025
Merged

[receiver/googlecloudpubsubpush] Add implementation#44101
songy23 merged 23 commits into
open-telemetry:mainfrom
constanca-m:googlecloudpubsub-implementation

Conversation

@constanca-m

Copy link
Copy Markdown
Contributor

Description

Add implementation to the googlecloudpubsubpush receiver.

Testing

Unit tests added.

Documentation

README already up to date.

Comment thread receiver/googlecloudpubsubpushreceiver/factory.go Outdated
Comment thread receiver/googlecloudpubsubpushreceiver/receiver.go Outdated
Comment thread receiver/googlecloudpubsubpushreceiver/receiver.go Outdated
Comment thread receiver/googlecloudpubsubpushreceiver/receiver.go Outdated
# Conflicts:
#	receiver/googlecloudpubsubpushreceiver/go.mod
#	receiver/googlecloudpubsubpushreceiver/go.sum

@axw axw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good overall, mostly quibbles

Comment thread receiver/googlecloudpubsubpushreceiver/receiver.go
Comment thread receiver/googlecloudpubsubpushreceiver/receiver.go Outdated
Comment thread receiver/googlecloudpubsubpushreceiver/receiver.go Outdated
Comment thread receiver/googlecloudpubsubpushreceiver/receiver_test.go Outdated
Comment thread receiver/googlecloudpubsubpushreceiver/receiver.go Outdated
Comment on lines +85 to +98
// Pub/Sub retries everything that is not a valid response. A valid response
// has the following HTTP codes: [102, 200, 201, 202, 204].
// You can verify this in the official documentation. For this, refer to
// https://cloud.google.com/pubsub/docs/push.
//
// This becomes an issue for permanent errors, because it means that if we
// don't return one of those codes, Pub/Sub will keep retrying. This would
// only stop retrying if:
// 1. We add event arc advanced after Pub/Sub. For this, we need to set the
// correct HTTP code for permanent/transient errors. You can refer to
// the official documentation for this. See:
// https://docs.cloud.google.com/eventarc/advanced/docs/retry-events#transient
// 2. Or return 2xx for permanent errors. Since this is not semantically correct,
// we are holding on this option.

@constanca-m constanca-m Nov 19, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@axw Here is the comment. What do you think of it? Is it time for us to return 2xx for permanent errors? I feel torn on it. It doesn't seem right, but at the same time, it is wrong to retry permanent errors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, that's very clear. It seems there's no perfect solution here, so we could consider adding configuration to control the response code in the case of permanent errors. Maybe in a followup?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's fine by me

// 2. Or return 2xx for permanent errors. Since this is not semantically correct,
// we are holding on this option.
logger.Error("failed to handle Pub/Sub push request", zap.Error(err))
code := http.StatusInternalServerError

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should still use different status codes depending on the gRPC error codes for retryable errors, but we can do that in a followup.

@axw axw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@songy23 songy23 merged commit b7f259a into open-telemetry:main Nov 19, 2025
190 checks passed
@github-actions github-actions Bot added this to the next release milestone Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants