Skip to content

Commit

Permalink
Upgrade dependency for next release (#3974)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt committed Feb 22, 2023
1 parent 3b71393 commit f522ff3
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 176 deletions.
2 changes: 0 additions & 2 deletions Makefile
Expand Up @@ -79,11 +79,9 @@ DB_TOOL_INTEGRATION_TEST_ROOT := ./tools/tests
INTEGRATION_TEST_DIRS := $(DB_INTEGRATION_TEST_ROOT) $(DB_TOOL_INTEGRATION_TEST_ROOT)
UNIT_TEST_DIRS := $(filter-out $(FUNCTIONAL_TEST_ROOT)% $(FUNCTIONAL_TEST_XDC_ROOT)% $(FUNCTIONAL_TEST_NDC_ROOT)% $(DB_INTEGRATION_TEST_ROOT)% $(DB_TOOL_INTEGRATION_TEST_ROOT)%,$(TEST_DIRS))

# go.opentelemetry.io/otel/sdk/metric@v0.31.0 - there are breaking changes in v0.32.0.
# github.com/urfave/cli/v2@v2.4.0 - needs to accept comma in values before unlocking https://github.com/urfave/cli/pull/1241.
PINNED_DEPENDENCIES := \
github.com/go-sql-driver/mysql@v1.5.0 \
go.opentelemetry.io/otel/sdk/metric@v0.31.0 \
github.com/urfave/cli/v2@v2.4.0

# Code coverage output files.
Expand Down
2 changes: 1 addition & 1 deletion common/headers/versionChecker.go
Expand Up @@ -46,7 +46,7 @@ const (
ClientNameCLI = "temporal-cli"
ClientNameUI = "temporal-ui"

ServerVersion = "1.20.0"
ServerVersion = "1.21.0"

// SupportedServerVersions is used by CLI and inter role communication.
SupportedServerVersions = ">=1.0.0 <2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion common/metrics/opentelemetry_provider.go
Expand Up @@ -73,7 +73,7 @@ func NewOpenTelemetryProvider(
for _, u := range []string{Dimensionless, Bytes, Milliseconds} {
views = append(views, sdkmetrics.NewView(
sdkmetrics.Instrument{
Kind: sdkmetrics.InstrumentKindSyncHistogram,
Kind: sdkmetrics.InstrumentKindHistogram,
Unit: unit.Unit(u),
},
sdkmetrics.Stream{
Expand Down
16 changes: 9 additions & 7 deletions common/metrics/otel_metrics_handler.go
Expand Up @@ -29,6 +29,7 @@ import (
"time"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/instrument"
otelunit "go.opentelemetry.io/otel/metric/unit"

Expand Down Expand Up @@ -67,7 +68,7 @@ func (omp *otelMetricsHandler) WithTags(tags ...Tag) Handler {

// Counter obtains a counter for the given name and MetricOptions.
func (omp *otelMetricsHandler) Counter(counter string) CounterIface {
c, err := omp.provider.GetMeter().SyncInt64().Counter(counter)
c, err := omp.provider.GetMeter().Int64Counter(counter)
if err != nil {
omp.l.Fatal("error getting metric", tag.NewStringTag("MetricName", counter), tag.Error(err))
}
Expand All @@ -79,15 +80,16 @@ func (omp *otelMetricsHandler) Counter(counter string) CounterIface {

// Gauge obtains a gauge for the given name and MetricOptions.
func (omp *otelMetricsHandler) Gauge(gauge string) GaugeIface {
c, err := omp.provider.GetMeter().AsyncFloat64().Gauge(gauge)
c, err := omp.provider.GetMeter().Float64ObservableGauge(gauge)
if err != nil {
omp.l.Fatal("error getting metric", tag.NewStringTag("MetricName", gauge), tag.Error(err))
}

return GaugeFunc(func(i float64, t ...Tag) {
err = omp.provider.GetMeter().RegisterCallback([]instrument.Asynchronous{c}, func(ctx context.Context) {
c.Observe(ctx, i, tagsToAttributes(omp.tags, t, omp.excludeTags)...)
})
_, err = omp.provider.GetMeter().RegisterCallback(func(ctx context.Context, o metric.Observer) error {
o.ObserveFloat64(c, i, tagsToAttributes(omp.tags, t, omp.excludeTags)...)
return nil
}, c)
if err != nil {
omp.l.Fatal("error setting callback metric update", tag.NewStringTag("MetricName", gauge), tag.Error(err))
}
Expand All @@ -96,7 +98,7 @@ func (omp *otelMetricsHandler) Gauge(gauge string) GaugeIface {

// Timer obtains a timer for the given name and MetricOptions.
func (omp *otelMetricsHandler) Timer(timer string) TimerIface {
c, err := omp.provider.GetMeter().SyncInt64().Histogram(timer, instrument.WithUnit(otelunit.Unit(Milliseconds)))
c, err := omp.provider.GetMeter().Int64Histogram(timer, instrument.WithUnit(otelunit.Unit(Milliseconds)))
if err != nil {
omp.l.Fatal("error getting metric", tag.NewStringTag("MetricName", timer), tag.Error(err))
}
Expand All @@ -108,7 +110,7 @@ func (omp *otelMetricsHandler) Timer(timer string) TimerIface {

// Histogram obtains a histogram for the given name and MetricOptions.
func (omp *otelMetricsHandler) Histogram(histogram string, unit MetricUnit) HistogramIface {
c, err := omp.provider.GetMeter().SyncInt64().Histogram(histogram, instrument.WithUnit(otelunit.Unit(unit)))
c, err := omp.provider.GetMeter().Int64Histogram(histogram, instrument.WithUnit(otelunit.Unit(unit)))
if err != nil {
omp.l.Fatal("error getting metric", tag.NewStringTag("MetricName", histogram), tag.Error(err))
}
Expand Down
47 changes: 26 additions & 21 deletions common/metrics/otel_metrics_handler_test.go
Expand Up @@ -66,7 +66,7 @@ func TestMeter(t *testing.T) {
sdkmetrics.WithView(
sdkmetrics.NewView(
sdkmetrics.Instrument{
Kind: sdkmetrics.InstrumentKindSyncHistogram,
Kind: sdkmetrics.InstrumentKindHistogram,
Unit: unit.Bytes,
},
sdkmetrics.Stream{
Expand All @@ -77,7 +77,7 @@ func TestMeter(t *testing.T) {
),
sdkmetrics.NewView(
sdkmetrics.Instrument{
Kind: sdkmetrics.InstrumentKindSyncHistogram,
Kind: sdkmetrics.InstrumentKindHistogram,
Unit: unit.Dimensionless,
},
sdkmetrics.Stream{
Expand All @@ -88,7 +88,7 @@ func TestMeter(t *testing.T) {
),
sdkmetrics.NewView(
sdkmetrics.Instrument{
Kind: sdkmetrics.InstrumentKindSyncHistogram,
Kind: sdkmetrics.InstrumentKindHistogram,
Unit: unit.Milliseconds,
},
sdkmetrics.Stream{
Expand Down Expand Up @@ -123,8 +123,8 @@ func TestMeter(t *testing.T) {
Data: metricdata.Sum[int64]{
DataPoints: []metricdata.DataPoint[int64]{
{
//Attributes: attribute.NewSet(attribute.String("taskqueue", "__sticky__")),
Value: 11,
Attributes: attribute.NewSet(attribute.String("taskqueue", "__sticky__")),
Value: 11,
},
},
Temporality: metricdata.CumulativeTemporality,
Expand All @@ -136,7 +136,9 @@ func TestMeter(t *testing.T) {
Data: metricdata.Sum[int64]{
DataPoints: []metricdata.DataPoint[int64]{
{
Value: 14,

Attributes: attribute.NewSet(attribute.String("taskqueue", tagExcludedValue)),
Value: 14,
},
},
Temporality: metricdata.CumulativeTemporality,
Expand All @@ -150,8 +152,8 @@ func TestMeter(t *testing.T) {
{
Count: 2,
BucketCounts: []uint64{0, 0, 0, 1, 1, 0},
Min: &minLatency,
Max: &maxLatency,
Min: metricdata.NewExtrema(minLatency),
Max: metricdata.NewExtrema(maxLatency),
Sum: 6503,
},
},
Expand All @@ -164,8 +166,8 @@ func TestMeter(t *testing.T) {
Data: metricdata.Gauge[float64]{
DataPoints: []metricdata.DataPoint[float64]{
{
//Attributes: attribute.NewSet(attribute.String("location", "Mare Imbrium")),
Value: 100,
Attributes: attribute.NewSet(attribute.String("location", "Mare Imbrium")),
Value: 100,
},
},
},
Expand All @@ -177,8 +179,8 @@ func TestMeter(t *testing.T) {
{
Count: 1,
BucketCounts: []uint64{0, 0, 1},
Min: &testBytes,
Max: &testBytes,
Min: metricdata.NewExtrema(testBytes),
Max: metricdata.NewExtrema(testBytes),
Sum: testBytes,
},
},
Expand All @@ -187,23 +189,26 @@ func TestMeter(t *testing.T) {
Unit: unit.Bytes,
},
}
if diff := cmp.Diff(want, got.ScopeMetrics[0].Metrics, cmp.Comparer(valuesEqual),
if diff := cmp.Diff(want, got.ScopeMetrics[0].Metrics,
cmp.Comparer(func(e1, e2 metricdata.Extrema) bool {
v1, ok1 := e1.Value()
v2, ok2 := e2.Value()
return ok1 && ok2 && v1 == v2
}),
cmp.Comparer(func(a1, a2 attribute.Set) bool {
return a1.Equals(&a2)
}),
cmpopts.SortSlices(func(x, y metricdata.Metrics) bool {
return x.Name < y.Name
}),
// TODO: No good way to verify metrics tag in attributes as a private field in the attribute.Set.
cmpopts.IgnoreFields(metricdata.DataPoint[int64]{}, "Attributes", "StartTime", "Time"),
cmpopts.IgnoreFields(metricdata.DataPoint[float64]{}, "Attributes", "StartTime", "Time"),
cmpopts.IgnoreFields(metricdata.HistogramDataPoint{}, "Attributes", "StartTime", "Time", "Bounds"),
cmpopts.IgnoreFields(metricdata.DataPoint[int64]{}, "StartTime", "Time"),
cmpopts.IgnoreFields(metricdata.DataPoint[float64]{}, "StartTime", "Time"),
cmpopts.IgnoreFields(metricdata.HistogramDataPoint{}, "StartTime", "Time", "Bounds"),
); diff != "" {
t.Errorf("mismatch (-want, got):\n%s", diff)
}
}

func valuesEqual(v1, v2 attribute.Value) bool {
return v1.AsInterface() == v2.AsInterface()
}

func recordMetrics(mp Handler) {
hitsCounter := mp.Counter("hits")
gauge := mp.Gauge("temp")
Expand Down
91 changes: 46 additions & 45 deletions go.mod
Expand Up @@ -3,16 +3,16 @@ module go.temporal.io/server
go 1.19

require (
cloud.google.com/go/storage v1.28.0
github.com/aws/aws-sdk-go v1.44.151
cloud.google.com/go/storage v1.29.0
github.com/aws/aws-sdk-go v1.44.203
github.com/blang/semver/v4 v4.0.0
github.com/brianvoe/gofakeit/v6 v6.19.0
github.com/brianvoe/gofakeit/v6 v6.20.1
github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
github.com/emirpasic/gods v1.18.1
github.com/fatih/color v1.13.0
github.com/fatih/color v1.14.1
github.com/go-sql-driver/mysql v1.5.0
github.com/gocql/gocql v1.3.0
github.com/gocql/gocql v1.3.1
github.com/gogo/protobuf v1.3.2
github.com/gogo/status v1.1.1
github.com/golang-jwt/jwt/v4 v4.4.3
Expand All @@ -31,79 +31,80 @@ require (
github.com/stretchr/testify v1.8.1
github.com/temporalio/ringpop-go v0.0.0-20220818230611-30bf23b490b2
github.com/temporalio/tchannel-go v1.22.1-0.20220818200552-1be8d8cffa5b
github.com/temporalio/tctl-kit v0.0.0-20221128225502-a682971cf481
github.com/uber-go/tally/v4 v4.1.3
github.com/urfave/cli v1.22.10
github.com/temporalio/tctl-kit v0.0.0-20230213052353-2342ea1e7d14
github.com/uber-go/tally/v4 v4.1.6
github.com/urfave/cli v1.22.12
github.com/urfave/cli/v2 v2.4.0
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.4
go.opentelemetry.io/otel v1.11.2
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.34.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.2
go.opentelemetry.io/otel/exporters/prometheus v0.34.0
go.opentelemetry.io/otel/metric v0.34.0
go.opentelemetry.io/otel/sdk v1.11.2
go.opentelemetry.io/otel/sdk/metric v0.34.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.39.0
go.opentelemetry.io/otel v1.13.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.36.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.13.0
go.opentelemetry.io/otel/exporters/prometheus v0.36.0
go.opentelemetry.io/otel/metric v0.36.0
go.opentelemetry.io/otel/sdk v1.13.0
go.opentelemetry.io/otel/sdk/metric v0.36.0
go.temporal.io/api v1.18.1
go.temporal.io/sdk v1.21.1
go.temporal.io/version v0.3.0
go.uber.org/atomic v1.10.0
go.uber.org/fx v1.18.2
go.uber.org/multierr v1.8.0
go.uber.org/fx v1.19.1
go.uber.org/multierr v1.9.0
go.uber.org/zap v1.24.0
golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9
golang.org/x/oauth2 v0.4.0
golang.org/x/time v0.2.0
google.golang.org/api v0.103.0
golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
golang.org/x/oauth2 v0.5.0
golang.org/x/time v0.3.0
google.golang.org/api v0.110.0
google.golang.org/grpc v1.53.0
google.golang.org/grpc/examples v0.0.0-20221201195934-736197138d20
google.golang.org/grpc/examples v0.0.0-20230216223317-abff344ead8f
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/validator.v2 v2.0.1
gopkg.in/yaml.v3 v3.0.1
modernc.org/sqlite v1.20.0
modernc.org/sqlite v1.20.4
)

require (
cloud.google.com/go v0.107.0 // indirect
cloud.google.com/go/compute v1.15.1 // indirect
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.8.0 // indirect
github.com/apache/thrift v0.17.0 // indirect
cloud.google.com/go/iam v0.12.0 // indirect
github.com/apache/thrift v0.18.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bitly/go-hostpool v0.1.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0
github.com/prometheus/common v0.37.0
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/common v0.39.0
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20220927061507-ef77025ab5aa // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/robfig/cron v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand All @@ -113,29 +114,29 @@ require (
github.com/uber-common/bark v1.3.0 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2 // indirect
go.opentelemetry.io/otel/trace v1.11.2
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.13.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.36.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.13.0 // indirect
go.opentelemetry.io/otel/trace v1.13.0
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/dig v1.15.0 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/mod v0.7.0 // indirect
go.uber.org/dig v1.16.1 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
modernc.org/cc/v3 v3.40.0 // indirect
modernc.org/ccgo/v3 v3.16.13 // indirect
modernc.org/libc v1.21.5 // indirect
modernc.org/libc v1.22.2 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.4.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/strutil v1.1.3 // indirect
modernc.org/token v1.1.0 // indirect
Expand Down

0 comments on commit f522ff3

Please sign in to comment.