feat(contrib/cloud.google.com/go/pubsub.v2): support cloud.google.com/go/pubsub/v2#3841
Conversation
c8b74c5 to
59542fc
Compare
|
|
||
| "cloud.google.com/go/pubsub" | ||
| "cloud.google.com/go/pubsub/pstest" | ||
| "cloud.google.com/go/pubsub/v2" |
There was a problem hiding this comment.
replaced v1 test because we cannot import both "cloud.google.com/go/pubsub" and "cloud.google.com/go/pubsub/v2" at the same time
panic: proto: file "google/pubsub/v1/schema.proto" is already registered
previously from: "cloud.google.com/go/pubsub/apiv1/pubsubpb"
currently from: "cloud.google.com/go/pubsub/v2/apiv1/pubsubpb"
See https://protobuf.dev/reference/go/faq#namespace-conflict
There was a problem hiding this comment.
would it be possible to do it in a different package? similar as how it is done in confluent-kafka-go v1 and v2
There was a problem hiding this comment.
I see, moved the pubsub v1 test to a different pacakge
|
Is there anything I need to do to support orchestrion? |
| "github.com/aws/aws-sdk-go-v2": {"AWS SDK v2", false}, | ||
| "github.com/bradfitz/gomemcache": {"Memcache", false}, | ||
| "cloud.google.com/go/pubsub.v1": {"Pub/Sub", false}, | ||
| "cloud.google.com/go/pubsub/v2": {"Pub/Sub v2", false}, |
There was a problem hiding this comment.
| "cloud.google.com/go/pubsub/v2": {"Pub/Sub v2", false}, | |
| "cloud.google.com/go/pubsub.v2": {"Pub/Sub v2", false}, |
There was a problem hiding this comment.
I though the map key should be valid external go package name. The map is referred in MarkIntegrationImported and it looks expect go package name.
I guess cloud.google.com/go/pubsub.v1 is wrong?
|
|
||
| "cloud.google.com/go/pubsub" | ||
| "cloud.google.com/go/pubsub/pstest" | ||
| "cloud.google.com/go/pubsub/v2" |
There was a problem hiding this comment.
would it be possible to do it in a different package? similar as how it is done in confluent-kafka-go v1 and v2
| @@ -0,0 +1,103 @@ | |||
| # Unless explicitly stated otherwise all files in this repository are licensed | |||
There was a problem hiding this comment.
if adding Orchestrion support we need to add an orchestrion integration test in internal/orchestrion/_integration
There was a problem hiding this comment.
@rarguelloF
Thank you.
One question about module dependencies.
./instrumentation/internal/namingschematest/go.mod and ./orchestriion/all/go.mod refers to contrib modules tagged v2.3.0-dev.1.
How can I add github.com/DataDog/dd-trace-go/contrib/cloud.google.com/go/pubsub.v2/v2 to these go.mod files? Should I split PRs?
There was a problem hiding this comment.
I've excluded changes for namingschematest and orchestrion in this PR because I couldn't find a way to add the new contrib package to ./instrumentation/internal/namingschematest/go.mod and ./orchestriion/all/go.mod.
Let me know how to do that if it's possible.
| // The motivation of this package is to support orchestrion, which cannot use the main package because it imports | ||
| // the cloud.google.com/go/pubsub/v2 package, and since orchestrion modifies the library code itself, | ||
| // this would cause an import cycle. | ||
| package tracing |
There was a problem hiding this comment.
it seems this package is pretty much the same as the one in v1. Could we reuse it to work for both v1 and v2 under contrib/cloud.google.com/go/pubsubtrace? (you can check contrib/confluentinc/confluent-kafka-go/kafkatrace as reference where we did something similar)
There was a problem hiding this comment.
I've added contrib/cloud.google.com/go/pubsubtrace package.
Please review the interface change of TracePublish and TraceReceiveFunc.
contrib/confluentinc/confluent-kafka-go/kafkatrace defines package version enum CKGoVersion and accept it in NewKafkaTracer. Should I do something similar instead of accepting componentName instrumentation.Package in TracePublish and TraceReceiveFunc?
c0c6131 to
94e27d6
Compare
|
We are also interesting in getting this merged due to the deprecation of pubsub v1... Anything we can do to support this? :) |
|
@rarguelloF Could you please review my PR? Are there any blockers? |
|
/merge |
|
View all feedbacks in Devflow UI.
This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
The expected merge time in
|
|
/merge |
|
View all feedbacks in Devflow UI.
PR already in the queue with status waiting |
|
Having an issue using this functionality. The pubsub trace module is not configured correctly. |
@ztkent, as stated here - #3840 (reply in thread) - this functionality will be part of the v2.3.0-release due by the end of SEP2025. Hence, you will have to wait for that release to start using this functionality...:) |
What does this PR do?
This PR adds a new package, contrib/cloud.google.com/go/pubsub.v2, which provides functions to trace the cloud.google.com/go/pubsub/v2 package.
The implementation is largely based on the existing contrib/cloud.google.com/go/pubsub.v1 package, with necessary updates to align with the library's official v2 migration guide.
The original contrib/cloud.google.com/go/pubsub.v1 package is retained as per the contribution guidelines.
Motivation
#3840
Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!