Skip to content

Commit

Permalink
[chore] Move back receiver definitions, make profile embed receiver (#…
Browse files Browse the repository at this point in the history
…11254)

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Sep 26, 2024
1 parent c155b14 commit 5cc717d
Show file tree
Hide file tree
Showing 18 changed files with 303 additions and 340 deletions.
212 changes: 0 additions & 212 deletions receiver/internal/factory.go

This file was deleted.

15 changes: 0 additions & 15 deletions receiver/internal/logs.go

This file was deleted.

15 changes: 0 additions & 15 deletions receiver/internal/metrics.go

This file was deleted.

15 changes: 0 additions & 15 deletions receiver/internal/profiles.go

This file was deleted.

17 changes: 0 additions & 17 deletions receiver/internal/receiver.go

This file was deleted.

15 changes: 0 additions & 15 deletions receiver/internal/traces.go

This file was deleted.

8 changes: 4 additions & 4 deletions receiver/otlpreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const (

// NewFactory creates a new OTLP receiver factory.
func NewFactory() receiver.Factory {
return receiver.NewFactory(
return receiverprofiles.NewFactory(
metadata.Type,
createDefaultConfig,
receiver.WithTraces(createTraces, metadata.TracesStability),
receiver.WithMetrics(createMetrics, metadata.MetricsStability),
receiver.WithLogs(createLog, metadata.LogsStability),
receiverprofiles.WithTraces(createTraces, metadata.TracesStability),
receiverprofiles.WithMetrics(createMetrics, metadata.MetricsStability),
receiverprofiles.WithLogs(createLog, metadata.LogsStability),
receiverprofiles.WithProfiles(createProfiles, metadata.ProfilesStability),
)
}
Expand Down
5 changes: 3 additions & 2 deletions receiver/otlpreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"go.opentelemetry.io/collector/consumer/consumerprofiles"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/internal/testutil"
"go.opentelemetry.io/collector/receiver/receiverprofiles"
"go.opentelemetry.io/collector/receiver/receivertest"
)

Expand Down Expand Up @@ -47,7 +48,7 @@ func TestCreateSameReceiver(t *testing.T) {
assert.NotNil(t, lReceiver)
require.NoError(t, err)

pReceiver, err := factory.CreateProfilesReceiver(context.Background(), creationSet, cfg, consumertest.NewNop())
pReceiver, err := factory.(receiverprofiles.Factory).CreateProfilesReceiver(context.Background(), creationSet, cfg, consumertest.NewNop())
assert.NotNil(t, pReceiver)
require.NoError(t, err)

Expand Down Expand Up @@ -415,7 +416,7 @@ func TestCreateProfilesReceiver(t *testing.T) {
creationSet := receivertest.NewNopSettings()
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tr, err := factory.CreateProfilesReceiver(ctx, creationSet, tt.cfg, tt.sink)
tr, err := factory.(receiverprofiles.Factory).CreateProfilesReceiver(ctx, creationSet, tt.cfg, tt.sink)
if tt.wantErr {
assert.Error(t, err)
return
Expand Down
Loading

0 comments on commit 5cc717d

Please sign in to comment.