Skip to content

Commit

Permalink
Upgrade OTel dependencies to v0.68.0 collector/collector-contrib (#1736)
Browse files Browse the repository at this point in the history
* Upgrade OTel dependencies to v0.68.0 collector/collector-contrib
  • Loading branch information
PaurushGarg authored Jan 4, 2023
1 parent ba14e5b commit df624a4
Show file tree
Hide file tree
Showing 15 changed files with 567 additions and 919 deletions.
11 changes: 6 additions & 5 deletions cmd/awscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"log"
"os"

"go.opentelemetry.io/collector/otelcol"

"github.com/spf13/cobra"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/featuregate"
"go.opentelemetry.io/collector/service"
"go.uber.org/zap"

"github.com/aws-observability/aws-otel-collector/pkg/config"
Expand Down Expand Up @@ -67,7 +68,7 @@ func main() {
Version: version.Version,
}

params := service.CollectorSettings{
params := otelcol.CollectorSettings{
Factories: factories,
BuildInfo: info,
LoggingOptions: []zap.Option{logger.WrapCoreOpt()},
Expand All @@ -78,7 +79,7 @@ func main() {
}
}

func runInteractive(params service.CollectorSettings) error {
func runInteractive(params otelcol.CollectorSettings) error {
cmd := newCommand(params)
err := cmd.Execute()
if err != nil {
Expand All @@ -101,7 +102,7 @@ func setCollectorConfigFromExtraCfg(extraCfg *extraconfig.ExtraConfig) {
}

// newCommand constructs a new cobra.Command using the given settings.
func newCommand(params service.CollectorSettings) *cobra.Command {
func newCommand(params otelcol.CollectorSettings) *cobra.Command {
flagSet := config.Flags()
// build the Command we will use that only has config/set flags
rootCmd := &cobra.Command{
Expand All @@ -114,7 +115,7 @@ func newCommand(params service.CollectorSettings) *cobra.Command {
}
// Initialize provider after flags have been set
params.ConfigProvider = config.GetConfigProvider(flagSet)
col, err := service.New(params)
col, err := otelcol.NewCollector(params)
if err != nil {
return fmt.Errorf("failed to construct the application: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/awscollector/main_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ package main
import (
"log"

"go.opentelemetry.io/collector/service"
"go.opentelemetry.io/collector/otelcol"

"github.com/aws-observability/aws-otel-collector/pkg/extraconfig"
"github.com/aws-observability/aws-otel-collector/pkg/userutils"
)

func run(params service.CollectorSettings) error {
func run(params otelcol.CollectorSettings) error {
// Try to switch user when the collector is running on a host.
// For container the user and group is determined by the deployed manifest.
if !extraconfig.IsRunningInContainer() {
Expand Down
5 changes: 3 additions & 2 deletions cmd/awscollector/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ package main
import (
"testing"

"go.opentelemetry.io/collector/otelcol"

"github.com/spf13/pflag"
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/service"

"github.com/aws-observability/aws-otel-collector/pkg/defaultcomponents"
)

func TestNewCommandFlagSet(t *testing.T) {
factories, _ := defaultcomponents.Components()
params := service.CollectorSettings{
params := otelcol.CollectorSettings{
Factories: factories,
}

Expand Down
8 changes: 4 additions & 4 deletions cmd/awscollector/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"github.com/pkg/errors"
"golang.org/x/sys/windows/svc"

"go.opentelemetry.io/collector/service"
"go.opentelemetry.io/collector/otelcol"
)

func run(params service.CollectorSettings) error {
func run(params otelcol.CollectorSettings) error {
isInteractive, err := svc.IsAnInteractiveSession()
if err != nil {
return errors.Wrap(err, "failed to determine if we are running in an interactive session")
Expand All @@ -42,9 +42,9 @@ func run(params service.CollectorSettings) error {
}
}

func runService(params service.CollectorSettings) error {
func runService(params otelcol.CollectorSettings) error {
// do not need to supply service name when startup is invoked through Service Control Manager directly
if err := svc.Run("", service.NewSvcHandler(params)); err != nil {
if err := svc.Run("", otelcol.NewSvcHandler(params)); err != nil {
return errors.Wrap(err, "failed to start service")
}

Expand Down
5 changes: 3 additions & 2 deletions cmd/healthcheck/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package main

import (
"fmt"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"net"
"net/http"
"net/http/httptest"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestHealthStatusHealthy(t *testing.T) {
Expand Down
252 changes: 128 additions & 124 deletions go.mod

Large diffs are not rendered by default.

851 changes: 251 additions & 600 deletions go.sum

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions pkg/config/config_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ import (
"log"
"os"

"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/confmap/converter/expandconverter"
"go.opentelemetry.io/collector/confmap/provider/envprovider"
"go.opentelemetry.io/collector/confmap/provider/fileprovider"
"go.opentelemetry.io/collector/confmap/provider/yamlprovider"
"go.opentelemetry.io/collector/otelcol"
"go.opentelemetry.io/collector/service"

"go.opentelemetry.io/collector/confmap"
)

const (
Expand All @@ -52,7 +50,7 @@ func GetConfigProvider(flags *flag.FlagSet) otelcol.ConfigProvider {
}

// create Config Provider Settings
settings := service.ConfigProviderSettings{
settings := otelcol.ConfigProviderSettings{
ResolverSettings: confmap.ResolverSettings{
URIs: loc,
Providers: mapProviders,
Expand All @@ -61,7 +59,7 @@ func GetConfigProvider(flags *flag.FlagSet) otelcol.ConfigProvider {
}

// get New config Provider
config_provider, err := service.NewConfigProvider(settings)
config_provider, err := otelcol.NewConfigProvider(settings)

if err != nil {
log.Panicf("Err on creating Config Provider: %v\n", err)
Expand Down
5 changes: 3 additions & 2 deletions pkg/config/config_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ import (
"path/filepath"
"testing"

"go.opentelemetry.io/collector/otelcol"

"github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver"
"github.com/spf13/cobra"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/service"

"github.com/aws-observability/aws-otel-collector/pkg/defaultcomponents"
)
Expand All @@ -36,7 +37,7 @@ func getValidTestConfigPath() string {
}
func TestGetCfgFactoryConfig(t *testing.T) {
factories, _ := defaultcomponents.Components()
params := service.CollectorSettings{
params := otelcol.CollectorSettings{
Factories: factories,
}

Expand Down
9 changes: 5 additions & 4 deletions pkg/defaultcomponents/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/loggingexporter"
"go.opentelemetry.io/collector/exporter/otlpexporter"
"go.opentelemetry.io/collector/exporter/otlphttpexporter"
"go.opentelemetry.io/collector/extension"
"go.opentelemetry.io/collector/extension/ballastextension"
"go.opentelemetry.io/collector/extension/zpagesextension"
"go.opentelemetry.io/collector/otelcol"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/batchprocessor"
"go.opentelemetry.io/collector/processor/memorylimiterprocessor"
"go.opentelemetry.io/collector/receiver"
Expand All @@ -64,7 +65,7 @@ import (
)

// Components register OTel components for ADOT-collector distribution
func Components() (component.Factories, error) {
func Components() (otelcol.Factories, error) {
var errs error

extensions, err := extension.MakeFactoryMap(
Expand Down Expand Up @@ -96,7 +97,7 @@ func Components() (component.Factories, error) {
errs = multierr.Append(errs, err)
}

processors, err := component.MakeProcessorFactoryMap(
processors, err := processor.MakeFactoryMap(
attributesprocessor.NewFactory(),
resourceprocessor.NewFactory(),
probabilisticsamplerprocessor.NewFactory(),
Expand Down Expand Up @@ -136,7 +137,7 @@ func Components() (component.Factories, error) {
errs = multierr.Append(errs, err)
}

factories := component.Factories{
factories := otelcol.Factories{
Extensions: extensions,
Receivers: receivers,
Processors: processors,
Expand Down
94 changes: 47 additions & 47 deletions pkg/lambdacomponents/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ module github.com/aws-observability/aws-otel-collector/pkg/lambdacomponents
go 1.18

require (
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter v0.67.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.67.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.67.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.67.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.67.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter v0.68.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.68.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.68.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.68.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.68.0
github.com/stretchr/testify v1.8.1
go.opentelemetry.io/collector/component v0.67.0
go.opentelemetry.io/collector/exporter/loggingexporter v0.67.0
go.opentelemetry.io/collector/exporter/otlpexporter v0.67.0
go.opentelemetry.io/collector/exporter/otlphttpexporter v0.67.0
go.opentelemetry.io/collector/receiver/otlpreceiver v0.67.0
go.uber.org/multierr v1.8.0
go.opentelemetry.io/collector/component v0.68.0
go.opentelemetry.io/collector/exporter/loggingexporter v0.68.0
go.opentelemetry.io/collector/exporter/otlpexporter v0.68.0
go.opentelemetry.io/collector/exporter/otlphttpexporter v0.68.0
go.opentelemetry.io/collector/receiver/otlpreceiver v0.68.0
go.uber.org/multierr v1.9.0
)

require (
github.com/aws/aws-sdk-go v1.44.155 // indirect
github.com/aws/aws-sdk-go-v2 v1.17.2 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.4 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.4 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.20 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.26 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.20 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.27 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.20 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.26 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.17.6 // indirect
github.com/aws/aws-sdk-go v1.44.163 // indirect
github.com/aws/aws-sdk-go-v2 v1.17.3 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.27 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.17.7 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
Expand All @@ -46,50 +46,50 @@ require (
github.com/google/uuid v1.3.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.12 // indirect
github.com/klauspost/compress v1.15.13 // indirect
github.com/knadh/koanf v1.4.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mostynb/go-grpc-compression v1.1.17 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.67.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.68.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.68.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics v0.68.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.68.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.68.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.68.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.68.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.68.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/prometheus v0.40.5 // indirect
github.com/prometheus/prometheus v0.40.7 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/tidwall/gjson v1.10.2 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/tinylru v1.1.0 // indirect
github.com/tidwall/wal v1.1.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector v0.67.0 // indirect
go.opentelemetry.io/collector/confmap v0.67.0 // indirect
go.opentelemetry.io/collector/consumer v0.67.0 // indirect
go.opentelemetry.io/collector/featuregate v0.67.0 // indirect
go.opentelemetry.io/collector/pdata v1.0.0-rc1 // indirect
go.opentelemetry.io/collector/semconv v0.67.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 // indirect
go.opentelemetry.io/otel v1.11.1 // indirect
go.opentelemetry.io/otel/metric v0.33.0 // indirect
go.opentelemetry.io/otel/trace v1.11.1 // indirect
go.opentelemetry.io/collector v0.68.0 // indirect
go.opentelemetry.io/collector/confmap v0.68.0 // indirect
go.opentelemetry.io/collector/consumer v0.68.0 // indirect
go.opentelemetry.io/collector/featuregate v0.68.0 // indirect
go.opentelemetry.io/collector/pdata v1.0.0-rc2 // indirect
go.opentelemetry.io/collector/semconv v0.68.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 // indirect
go.opentelemetry.io/otel v1.11.2 // indirect
go.opentelemetry.io/otel/metric v0.34.0 // indirect
go.opentelemetry.io/otel/trace v1.11.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.3.0 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
google.golang.org/genproto v0.0.0-20221206210731-b1a01be3a5f6 // indirect
Expand Down
Loading

0 comments on commit df624a4

Please sign in to comment.