From 3505e7acfd1ce6dd44fa266063c62c98a2586b5a Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Tue, 7 May 2024 15:20:39 +0300 Subject: [PATCH 1/2] chore: release v1.26.2 (release.sh) --- example/aws-elasticbeanstalk/go.mod | 2 +- example/aws-lambda/function/go.mod | 2 +- example/basic/go.mod | 2 +- example/metrics/go.mod | 2 +- example/otel-api/go.mod | 2 +- example/panic/go.mod | 2 +- example/tutorial/go.mod | 2 +- example/zerolog-vector/go.mod | 2 +- uptrace/version.go | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/example/aws-elasticbeanstalk/go.mod b/example/aws-elasticbeanstalk/go.mod index 452de5b4..fe612d5c 100644 --- a/example/aws-elasticbeanstalk/go.mod +++ b/example/aws-elasticbeanstalk/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.1 replace github.com/uptrace/uptrace-go => ../.. require ( - github.com/uptrace/uptrace-go v1.26.0 + github.com/uptrace/uptrace-go v1.26.2 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 go.opentelemetry.io/otel/trace v1.26.0 ) diff --git a/example/aws-lambda/function/go.mod b/example/aws-lambda/function/go.mod index 48b5ea6c..df2f801d 100644 --- a/example/aws-lambda/function/go.mod +++ b/example/aws-lambda/function/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/aws-lambda-go v1.47.0 github.com/aws/aws-sdk-go-v2/config v1.27.11 github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 - github.com/uptrace/uptrace-go v1.26.0 + github.com/uptrace/uptrace-go v1.26.2 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.51.0 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.51.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 diff --git a/example/basic/go.mod b/example/basic/go.mod index e910f9b4..21c1fea0 100644 --- a/example/basic/go.mod +++ b/example/basic/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.1 replace github.com/uptrace/uptrace-go => ../.. require ( - github.com/uptrace/uptrace-go v1.26.0 + github.com/uptrace/uptrace-go v1.26.2 go.opentelemetry.io/otel v1.26.0 go.opentelemetry.io/otel/trace v1.26.0 ) diff --git a/example/metrics/go.mod b/example/metrics/go.mod index 618a9160..28ae3bf9 100644 --- a/example/metrics/go.mod +++ b/example/metrics/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.1 replace github.com/uptrace/uptrace-go => ../.. require ( - github.com/uptrace/uptrace-go v1.26.0 + github.com/uptrace/uptrace-go v1.26.2 go.opentelemetry.io/otel v1.26.0 go.opentelemetry.io/otel/metric v1.26.0 ) diff --git a/example/otel-api/go.mod b/example/otel-api/go.mod index 920bc7ee..edc363ef 100644 --- a/example/otel-api/go.mod +++ b/example/otel-api/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.1 replace github.com/uptrace/uptrace-go => ../.. require ( - github.com/uptrace/uptrace-go v1.26.0 + github.com/uptrace/uptrace-go v1.26.2 go.opentelemetry.io/otel v1.26.0 go.opentelemetry.io/otel/trace v1.26.0 ) diff --git a/example/panic/go.mod b/example/panic/go.mod index 3a07d93d..72e42239 100644 --- a/example/panic/go.mod +++ b/example/panic/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.1 replace github.com/uptrace/uptrace-go => ../.. -require github.com/uptrace/uptrace-go v1.26.0 +require github.com/uptrace/uptrace-go v1.26.2 require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect diff --git a/example/tutorial/go.mod b/example/tutorial/go.mod index becf94a3..e54499bf 100644 --- a/example/tutorial/go.mod +++ b/example/tutorial/go.mod @@ -8,7 +8,7 @@ replace github.com/uptrace/uptrace-go => ../.. require ( github.com/uptrace/opentelemetry-go-extra/otelzap v0.2.4 - github.com/uptrace/uptrace-go v1.26.0 + github.com/uptrace/uptrace-go v1.26.2 go.opentelemetry.io/otel v1.26.0 go.uber.org/zap v1.27.0 ) diff --git a/example/zerolog-vector/go.mod b/example/zerolog-vector/go.mod index a00ad862..959cdfda 100644 --- a/example/zerolog-vector/go.mod +++ b/example/zerolog-vector/go.mod @@ -8,7 +8,7 @@ replace github.com/uptrace/uptrace-go => ../.. require ( github.com/rs/zerolog v1.32.0 - github.com/uptrace/uptrace-go v1.26.0 + github.com/uptrace/uptrace-go v1.26.2 go.opentelemetry.io/otel v1.26.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) diff --git a/uptrace/version.go b/uptrace/version.go index 0923bd11..d90022b5 100644 --- a/uptrace/version.go +++ b/uptrace/version.go @@ -2,5 +2,5 @@ package uptrace // Version is the current release version. func Version() string { - return "1.26.0" + return "1.26.2" } From 36e1ac964b46f6871decc2728a531064399a61c1 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Tue, 7 May 2024 15:29:06 +0300 Subject: [PATCH 2/2] chore: fix dsn test --- uptrace/dsn.go | 8 ++++++++ uptrace/dsn_test.go | 39 ++++++++++++++++++++++++++++++++------- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/uptrace/dsn.go b/uptrace/dsn.go index 875ea2e8..6a5d90a3 100644 --- a/uptrace/dsn.go +++ b/uptrace/dsn.go @@ -76,6 +76,14 @@ func ParseDSN(dsnStr string) (*DSN, error) { if dsn.Host == "api.uptrace.dev" { dsn.Host = "uptrace.dev" } + if dsn.HTTPPort == "" { + switch dsn.Scheme { + case "http": + dsn.HTTPPort = "80" + case "https": + dsn.HTTPPort = "443" + } + } query := u.Query() if grpc := query.Get("grpc"); grpc != "" { diff --git a/uptrace/dsn_test.go b/uptrace/dsn_test.go index eea2a696..e3887331 100644 --- a/uptrace/dsn_test.go +++ b/uptrace/dsn_test.go @@ -12,28 +12,52 @@ import ( func TestParseDSN(t *testing.T) { type Test struct { dsn string - otlp string + grpc string + http string siteURL string } tests := []Test{ - {"https://token@uptrace.dev/1", "otlp.uptrace.dev:4317", "https://app.uptrace.dev"}, - {"https://token@api.uptrace.dev/1", "otlp.uptrace.dev:4317", "https://app.uptrace.dev"}, + { + "https://token@uptrace.dev/1", + "otlp.uptrace.dev:4317", + "otlp.uptrace.dev:443", + "https://app.uptrace.dev", + }, + { + "https://token@api.uptrace.dev/1", + "otlp.uptrace.dev:4317", + "otlp.uptrace.dev:443", + "https://app.uptrace.dev", + }, { "https://token@demo.uptrace.dev/1?grpc=4317", "demo.uptrace.dev:4317", - "https://demo.uptrace.dev", + "demo.uptrace.dev:443", + "https://demo.uptrace.dev:443", + }, + { + "https://token@localhost:1234/1", + "localhost:1234", + "localhost:1234", + "https://localhost:1234", + }, + { + "http://token@localhost:14317/project_id", + "localhost:14317", + "localhost:14318", + "http://localhost:14318", }, - {"https://token@localhost:1234/1", "localhost:1234", "https://localhost:1234"}, - {"http://token@localhost:14317/project_id", "localhost:14317", "http://localhost:14318"}, { "https://AQDan_E_EPe3QAF9fMP0PiVr5UWOu4q5@demo-api.uptrace.dev:4317/1", "demo-api.uptrace.dev:4317", + "demo-api.uptrace.dev:4317", "https://demo-api.uptrace.dev:4317", }, { "http://Qcn7rcwWO_w0ePo7WmeUtw@localhost:14318?grpc=14317", "localhost:14317", + "localhost:14318", "http://localhost:14318", }, } @@ -41,7 +65,8 @@ func TestParseDSN(t *testing.T) { t.Run(fmt.Sprint(i), func(t *testing.T) { dsn, err := uptrace.ParseDSN(test.dsn) require.NoError(t, err) - require.Equal(t, test.otlp, dsn.OTLPEndpoint()) + require.Equal(t, test.grpc, dsn.OTLPGrpcEndpoint()) + require.Equal(t, test.http, dsn.OTLPHttpEndpoint()) require.Equal(t, test.siteURL, dsn.SiteURL()) }) }