Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update core dependency and adopt to its API changes #9231

Merged
merged 1 commit into from
Apr 13, 2022
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 6 additions & 3 deletions cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib v0.48.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.48.0
github.com/stretchr/testify v1.7.1
go.opentelemetry.io/collector v0.48.0
go.opentelemetry.io/collector/model v0.48.0
go.opentelemetry.io/collector v0.48.1-0.20220412005140-8eb68f40028d
go.opentelemetry.io/collector/pdata v0.0.0-20220412005140-8eb68f40028d
go.uber.org/multierr v1.8.0
golang.org/x/mod v0.5.1
golang.org/x/text v0.3.7
Expand Down Expand Up @@ -188,7 +188,7 @@ require (
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/knadh/koanf v1.4.0 // indirect
github.com/knadh/koanf v1.4.1 // indirect
github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b // indirect
github.com/leoluk/perflib_exporter v0.1.0 // indirect
github.com/lib/pq v1.10.5 // indirect
Expand Down Expand Up @@ -440,6 +440,7 @@ require (
go.etcd.io/bbolt v1.3.6 // indirect
go.mongodb.org/atlas v0.15.0 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/collector/model v0.48.1-0.20220412005140-8eb68f40028d // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.31.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect
go.opentelemetry.io/otel v1.6.3 // indirect
Expand Down Expand Up @@ -802,3 +803,5 @@ exclude github.com/StackExchange/wmi v1.2.0

// see https://github.com/distribution/distribution/issues/3590
exclude github.com/docker/distribution v2.8.0+incompatible

replace go.opentelemetry.io/collector/pdata => go.opentelemetry.io/collector/pdata v0.0.0-20220412005140-8eb68f40028d
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
24 changes: 13 additions & 11 deletions cmd/configschema/go.sum

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

4 changes: 2 additions & 2 deletions cmd/configschema/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/model/pdata"
"go.opentelemetry.io/collector/pdata/pmetric"

"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry"
)
Expand All @@ -38,7 +38,7 @@ func TestPackageDirLocal(t *testing.T) {
}

func TestPackageDirError(t *testing.T) {
pkg := pdata.NewSum()
pkg := pmetric.NewSum()
pkgType := reflect.ValueOf(pkg).Type()
srcRoot := "test/fail"
dr := NewDirResolver(srcRoot, DefaultModule)
Expand Down
11 changes: 6 additions & 5 deletions cmd/mdatagen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@ require (
github.com/go-playground/universal-translator v0.18.0
github.com/go-playground/validator/v10 v10.10.1
github.com/stretchr/testify v1.7.1
go.opentelemetry.io/collector v0.48.0
go.opentelemetry.io/collector/model v0.48.0
go.opentelemetry.io/collector v0.48.1-0.20220412005140-8eb68f40028d
go.opentelemetry.io/collector/pdata v0.0.0-00010101000000-000000000000
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/knadh/koanf v1.4.0 // indirect
github.com/knadh/koanf v1.4.1 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

replace go.opentelemetry.io/collector/pdata => go.opentelemetry.io/collector/pdata v0.0.0-20220412005140-8eb68f40028d
18 changes: 8 additions & 10 deletions cmd/mdatagen/go.sum

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

26 changes: 13 additions & 13 deletions cmd/mdatagen/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/go-playground/validator/v10/non-standard/validators"
en_translations "github.com/go-playground/validator/v10/translations/en"
"go.opentelemetry.io/collector/config/mapprovider/filemapprovider"
"go.opentelemetry.io/collector/model/pdata"
"go.opentelemetry.io/collector/pdata/pcommon"
)

type metricName string
Expand All @@ -52,24 +52,24 @@ func (mn attributeName) RenderUnexported() (string, error) {
// ValueType defines an attribute value type.
type ValueType struct {
// ValueType is type of the metric number, options are "double", "int".
ValueType pdata.ValueType
ValueType pcommon.ValueType
}

// UnmarshalText implements the encoding.TextUnmarshaler interface.
func (mvt *ValueType) UnmarshalText(text []byte) error {
switch vtStr := string(text); vtStr {
case "":
mvt.ValueType = pdata.ValueTypeEmpty
mvt.ValueType = pcommon.ValueTypeEmpty
case "string":
mvt.ValueType = pdata.ValueTypeString
mvt.ValueType = pcommon.ValueTypeString
case "int":
mvt.ValueType = pdata.ValueTypeInt
mvt.ValueType = pcommon.ValueTypeInt
case "double":
mvt.ValueType = pdata.ValueTypeDouble
mvt.ValueType = pcommon.ValueTypeDouble
case "bool":
mvt.ValueType = pdata.ValueTypeDouble
mvt.ValueType = pcommon.ValueTypeDouble
case "bytes":
mvt.ValueType = pdata.ValueTypeDouble
mvt.ValueType = pcommon.ValueTypeDouble
default:
return fmt.Errorf("invalid type: %q", vtStr)
}
Expand All @@ -84,15 +84,15 @@ func (mvt ValueType) String() string {
// Primitive returns name of primitive type for the ValueType.
func (mvt ValueType) Primitive() string {
switch mvt.ValueType {
case pdata.ValueTypeString:
case pcommon.ValueTypeString:
return "string"
case pdata.ValueTypeInt:
case pcommon.ValueTypeInt:
return "int64"
case pdata.ValueTypeDouble:
case pcommon.ValueTypeDouble:
return "float64"
case pdata.ValueTypeBool:
case pcommon.ValueTypeBool:
return "bool"
case pdata.ValueTypeBytes:
case pcommon.ValueTypeBytes:
return "[]byte"
default:
return ""
Expand Down
6 changes: 3 additions & 3 deletions cmd/mdatagen/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/model/pdata"
"go.opentelemetry.io/collector/pdata/pmetric"
)

func Test_loadMetadata(t *testing.T) {
Expand Down Expand Up @@ -53,7 +53,7 @@ func Test_loadMetadata(t *testing.T) {
ExtendedDocumentation: "Additional information on CPU Time can be found [here](https://en.wikipedia.org/wiki/CPU_time).",
Unit: "s",
Sum: &sum{
MetricValueType: MetricValueType{pdata.MetricValueTypeDouble},
MetricValueType: MetricValueType{pmetric.MetricValueTypeDouble},
Aggregated: Aggregated{Aggregation: "cumulative"},
Mono: Mono{Monotonic: true},
},
Expand All @@ -64,7 +64,7 @@ func Test_loadMetadata(t *testing.T) {
Description: "Percentage of CPU time broken down by different states.",
Unit: "1",
Gauge: &gauge{
MetricValueType: MetricValueType{pdata.MetricValueTypeDouble},
MetricValueType: MetricValueType{pmetric.MetricValueTypeDouble},
},
Attributes: []attributeName{"enumAttribute"},
},
Expand Down
Loading