Skip to content

Commit

Permalink
Use internal/otelarrow in exporter/otelarrowexporter (#34137)
Browse files Browse the repository at this point in the history
**Description:** Removes external dependencies.

**Link to tracking Issue:** #33567

---------

Co-authored-by: Alex Boten <[email protected]>
  • Loading branch information
jmacd and codeboten authored Jul 17, 2024
1 parent f82eaeb commit 2997a90
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 23 deletions.
1 change: 1 addition & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => ../../internal/aws/cwlogs
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics => ../../internal/exp/metrics
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow => ../../internal/otelarrow
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver => ../../receiver/awsxrayreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureblobreceiver => ../../receiver/azureblobreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sobjectsreceiver => ../../receiver/k8sobjectsreceiver
Expand Down
3 changes: 3 additions & 0 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.105.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.105.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.105.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow v0.105.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.105.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.105.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.105.0 // indirect
Expand Down Expand Up @@ -854,6 +855,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/commo

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics => ../../internal/exp/metrics

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow => ../../internal/otelarrow

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver => ../../receiver/awsxrayreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureblobreceiver => ../../receiver/azureblobreceiver
Expand Down
2 changes: 1 addition & 1 deletion exporter/otelarrowexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"time"

"github.com/open-telemetry/otel-arrow/collector/compression/zstd"
"github.com/open-telemetry/otel-arrow/pkg/config"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configcompression"
Expand All @@ -17,6 +16,7 @@ import (
"google.golang.org/grpc"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/arrow"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/compression/zstd"
)

// Config defines configuration for OTLP exporter.
Expand Down
2 changes: 1 addition & 1 deletion exporter/otelarrowexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"testing"
"time"

"github.com/open-telemetry/otel-arrow/collector/compression/zstd"
"github.com/open-telemetry/otel-arrow/pkg/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -24,6 +23,7 @@ import (
"go.opentelemetry.io/collector/exporter/exporterhelper"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/arrow"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/compression/zstd"
)

func TestUnmarshalDefaultConfig(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions exporter/otelarrowexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"time"

arrowpb "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1"
"github.com/open-telemetry/otel-arrow/collector/compression/zstd"
"github.com/open-telemetry/otel-arrow/collector/netstats"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configcompression"
"go.opentelemetry.io/collector/config/configgrpc"
Expand All @@ -23,6 +21,8 @@ import (

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/arrow"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/compression/zstd"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/netstats"
)

// NewFactory creates a factory for OTLP exporter.
Expand Down
4 changes: 2 additions & 2 deletions exporter/otelarrowexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"testing"
"time"

"github.com/open-telemetry/otel-arrow/collector/compression/zstd"
"github.com/open-telemetry/otel-arrow/collector/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component/componenttest"
Expand All @@ -24,6 +22,8 @@ import (
"go.opentelemetry.io/collector/exporter/exportertest"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/arrow"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/compression/zstd"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/testutil"
)

func TestCreateDefaultConfig(t *testing.T) {
Expand Down
8 changes: 6 additions & 2 deletions exporter/otelarrowexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.21.0

require (
github.com/apache/arrow/go/v16 v16.1.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow v0.105.0
github.com/open-telemetry/otel-arrow v0.24.0
github.com/open-telemetry/otel-arrow/collector v0.24.0
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector v0.105.1-0.20240717163034-43ed6184f9fe
go.opentelemetry.io/collector/component v0.105.1-0.20240717163034-43ed6184f9fe
Expand Down Expand Up @@ -54,7 +54,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
Expand Down Expand Up @@ -92,3 +92,7 @@ require (
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow => ../../internal/otelarrow

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/otelarrowreceiver => ../../receiver/otelarrowreceiver
6 changes: 2 additions & 4 deletions exporter/otelarrowexporter/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 exporter/otelarrowexporter/internal/arrow/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

arrowpb "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1"
arrowCollectorMock "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1/mock"
"github.com/open-telemetry/otel-arrow/collector/testdata"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.uber.org/mock/gomock"
Expand All @@ -24,6 +23,7 @@ import (
"google.golang.org/grpc/status"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/arrow/grpcmock"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/testdata"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion exporter/otelarrowexporter/internal/arrow/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

arrowpb "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1"
"github.com/open-telemetry/otel-arrow/collector/netstats"
arrowRecord "github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/plog"
Expand All @@ -23,6 +22,8 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/status"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/netstats"
)

// Exporter is 1:1 with exporter, isolates arrow-specific
Expand Down
5 changes: 3 additions & 2 deletions exporter/otelarrowexporter/internal/arrow/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
"time"

arrowpb "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1"
"github.com/open-telemetry/otel-arrow/collector/netstats"
"github.com/open-telemetry/otel-arrow/collector/testdata"
arrowRecord "github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record"
arrowRecordMock "github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record/mock"
otelAssert "github.com/open-telemetry/otel-arrow/pkg/otel/assert"
Expand All @@ -33,6 +31,9 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/netstats"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/testdata"
)

var AllPrioritizers = []PrioritizerName{LeastLoadedPrioritizer, LeastLoadedTwoPrioritizer}
Expand Down
3 changes: 2 additions & 1 deletion exporter/otelarrowexporter/internal/arrow/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

arrowpb "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1"
"github.com/open-telemetry/otel-arrow/collector/netstats"
arrowRecord "github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/plog"
Expand All @@ -28,6 +27,8 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/netstats"
)

// Stream is 1:1 with gRPC stream.
Expand Down
3 changes: 2 additions & 1 deletion exporter/otelarrowexporter/internal/arrow/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ import (
"time"

arrowpb "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1"
"github.com/open-telemetry/otel-arrow/collector/netstats"
arrowRecordMock "github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record/mock"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/netstats"
)

var oneBatch = &arrowpb.BatchArrowRecords{
Expand Down

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

4 changes: 2 additions & 2 deletions exporter/otelarrowexporter/otelarrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"time"

arrowPkg "github.com/apache/arrow/go/v16/arrow"
"github.com/open-telemetry/otel-arrow/collector/compression/zstd"
"github.com/open-telemetry/otel-arrow/collector/netstats"
arrowRecord "github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configcompression"
Expand All @@ -35,6 +33,8 @@ import (
"google.golang.org/grpc/status"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/arrow"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/compression/zstd"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/netstats"
)

type baseExporter struct {
Expand Down
2 changes: 1 addition & 1 deletion exporter/otelarrowexporter/otelarrow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (

arrowpb "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1"
arrowpbMock "github.com/open-telemetry/otel-arrow/api/experimental/arrow/v1/mock"
"github.com/open-telemetry/otel-arrow/collector/testdata"
arrowRecord "github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -51,6 +50,7 @@ import (
"google.golang.org/protobuf/types/known/durationpb"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/otelarrowexporter/internal/arrow/grpcmock"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/otelarrow/testdata"
)

type mockReceiver struct {
Expand Down

0 comments on commit 2997a90

Please sign in to comment.