Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chloggen/chore-exporter-googlecloudpubsub-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
component: exporter/googlecloudpubsub

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Update to cloud.google.com/go/pubsub/v2.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [44465]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
27 changes: 27 additions & 0 deletions .chloggen/chore-receiver-googlecloudpubsub-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
component: receiver/googlecloudpubsub

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Update to cloud.google.com/go/pubsub/v2.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [44466]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
6 changes: 3 additions & 3 deletions receiver/googlecloudpubsubreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/google
go 1.24.0

require (
cloud.google.com/go/pubsub v1.49.0
cloud.google.com/go/pubsub/v2 v2.3.0
github.com/googleapis/gax-go/v2 v2.15.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.140.1
github.com/stretchr/testify v1.11.1
Expand All @@ -30,7 +30,7 @@ require (
)

require (
cloud.google.com/go v0.120.0 // indirect
cloud.google.com/go v0.121.6 // indirect
cloud.google.com/go/auth v0.17.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
Expand All @@ -56,7 +56,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
go.einride.tech/aip v0.68.1 // indirect
go.einride.tech/aip v0.73.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/collector/client v1.46.1-0.20251120204106-2e9c82787618 // indirect
go.opentelemetry.io/collector/config/configoptional v1.46.1-0.20251120204106-2e9c82787618 // indirect
Expand Down
16 changes: 8 additions & 8 deletions receiver/googlecloudpubsubreceiver/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion receiver/googlecloudpubsubreceiver/internal/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sync/atomic"
"time"

"cloud.google.com/go/pubsub/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/v2/apiv1/pubsubpb"
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
Expand Down
8 changes: 4 additions & 4 deletions receiver/googlecloudpubsubreceiver/internal/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"testing"
"time"

pubsub "cloud.google.com/go/pubsub/apiv1"
"cloud.google.com/go/pubsub/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/pstest"
pubsub "cloud.google.com/go/pubsub/v2/apiv1"
"cloud.google.com/go/pubsub/v2/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/v2/pstest"
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/receiver/receivertest"
"google.golang.org/api/option"
Expand Down Expand Up @@ -46,7 +46,7 @@ func TestCancelStream(t *testing.T) {
settings := receivertest.NewNopSettings(metadata.Type)
telemetryBuilder, _ := metadata.NewTelemetryBuilder(settings.TelemetrySettings)

client, err := pubsub.NewSubscriberClient(ctx, copts...)
client, err := pubsub.NewSubscriptionAdminClient(ctx, copts...)
assert.NoError(t, err)

handler, err := NewHandler(ctx, settings, telemetryBuilder, client, "client-id", "projects/my-project/subscriptions/otlp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package internal // import "github.com/open-telemetry/opentelemetry-collector-co
import (
"context"

"cloud.google.com/go/pubsub/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/v2/apiv1/pubsubpb"
"github.com/googleapis/gax-go/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion receiver/googlecloudpubsubreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"sync"

"cloud.google.com/go/pubsub/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/v2/apiv1/pubsubpb"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/pdata/plog"
Expand Down
4 changes: 2 additions & 2 deletions receiver/googlecloudpubsubreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"
"time"

pb "cloud.google.com/go/pubsub/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/pstest"
pb "cloud.google.com/go/pubsub/v2/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/v2/pstest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"fmt"

pubsub "cloud.google.com/go/pubsub/apiv1"
pubsub "cloud.google.com/go/pubsub/v2/apiv1"
"google.golang.org/api/option"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand All @@ -34,7 +34,7 @@ func newSubscriberClient(ctx context.Context, config *Config, userAgent string)
return nil, fmt.Errorf("failed preparing the gRPC client options to PubSub: %w", err)
}

client, err := pubsub.NewSubscriberClient(ctx, clientOptions...)
client, err := pubsub.NewSubscriptionAdminClient(ctx, clientOptions...)
if err != nil {
return nil, fmt.Errorf("failed creating the gRPC client to PubSub: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package googlecloudpubsubreceiver
import (
"testing"

pubsub "cloud.google.com/go/pubsub/apiv1"
pubsub "cloud.google.com/go/pubsub/v2/apiv1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/api/option"
Expand Down Expand Up @@ -88,7 +88,7 @@ func TestNewSubscriberClient(t *testing.T) {
client, err := newSubscriberClient(ctx, cfg, "test-user-agent 6789")
assert.NoError(t, err)
require.NotEmpty(t, client)
assert.IsType(t, &pubsub.SubscriberClient{}, client)
assert.IsType(t, &pubsub.SubscriptionAdminClient{}, client)
assert.NoError(t, client.Close())
})

Expand All @@ -103,7 +103,7 @@ func TestNewSubscriberClient(t *testing.T) {
client, err := newSubscriberClient(ctx, cfg, "test-user-agent 6789")
assert.NoError(t, err)
require.NotEmpty(t, client)
assert.IsType(t, &pubsub.SubscriberClient{}, client)
assert.IsType(t, &pubsub.SubscriptionAdminClient{}, client)
assert.NoError(t, client.Close())
})

Expand Down