diff --git a/CHANGELOG.md b/CHANGELOG.md index 2280be84ca2..18d8d349589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Added -- Adds HTTP support for OTLP metrics exporter. (#2022) - Added `WithOSDescription` resource configuration option to set OS (Operating System) description resource attribute (`os.description`). (#1840) - Added `WithOS` resource configuration option to set all OS (Operating System) resource attributes at once. (#1840) @@ -22,7 +21,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Removed -- Removed the deprecated package `go.opentelemetry.io/otel/exporters/metric/prometheus`. (#2020) - Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/jaeger`. (#2020) - Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/zipkin`. (#2020) - Removed the resource.WithBuiltinDetectors() function in favor of explicit WithFeature() options for every built-in detector. (#2026) @@ -32,9 +30,21 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - When using WithNewRoot, don't use the parent context for making sampling decisions. (#2032) - `oteltest.Tracer` now creates a valid `SpanContext` when using `WithNewRoot`. (#2073) - OS type detector now sets the correct `dragonflybsd` value for DragonFly BSD. (#2092) +- The OTel span status is correctly transformed into the OTLP status in the `go.opentelemetry.io/otel/exporters/otlp/otlptrace` package. + This fix will by default set the status to `Unset` if it is not explicitly set to `Ok` or `Error`. (#2099 #2102) ### Security +## [Experimental Metrics v0.22.0] - 2021-07-19 + +### Added + +- Adds HTTP support for OTLP metrics exporter. (#2022) + +### Removed + +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/metric/prometheus`. (#2020) + ## [1.0.0-RC1] / 0.21.0 - 2021-06-18 With this release we are introducing a split in module versions. The tracing API and SDK are entering the `v1.0.0` Release Candidate phase with `v1.0.0-RC1` @@ -1431,6 +1441,7 @@ It contains api and sdk for trace and meter. - CODEOWNERS file to track owners of this project. [Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.0.0-RC1...HEAD +[Experimental Metrics v0.22.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.22.0 [1.0.0-RC1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC1 [0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0 [0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0 diff --git a/bridge/opencensus/go.mod b/bridge/opencensus/go.mod index 76b1d5fc2d0..4f83d71ef09 100644 --- a/bridge/opencensus/go.mod +++ b/bridge/opencensus/go.mod @@ -5,10 +5,10 @@ go 1.15 require ( go.opencensus.io v0.22.6-0.20201102222123-380f4078db9f go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/metric v0.21.0 + go.opentelemetry.io/otel/metric v0.22.0 go.opentelemetry.io/otel/oteltest v1.0.0-RC1 go.opentelemetry.io/otel/sdk v1.0.0-RC1 - go.opentelemetry.io/otel/sdk/export/metric v0.21.0 + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 go.opentelemetry.io/otel/trace v1.0.0-RC1 ) diff --git a/example/opencensus/go.mod b/example/opencensus/go.mod index 75a94cea656..b3877fc5f34 100644 --- a/example/opencensus/go.mod +++ b/example/opencensus/go.mod @@ -12,10 +12,10 @@ require ( go.opencensus.io v0.22.6-0.20201102222123-380f4078db9f go.opentelemetry.io/otel v1.0.0-RC1 go.opentelemetry.io/otel/bridge/opencensus v0.21.0 - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.21.0 + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.22.0 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.0.0-RC1 go.opentelemetry.io/otel/sdk v1.0.0-RC1 - go.opentelemetry.io/otel/sdk/export/metric v0.21.0 + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 ) replace go.opentelemetry.io/otel/bridge/opentracing => ../../bridge/opentracing diff --git a/example/prometheus/go.mod b/example/prometheus/go.mod index b5765ab73ff..4b6ff8803b7 100644 --- a/example/prometheus/go.mod +++ b/example/prometheus/go.mod @@ -10,10 +10,10 @@ replace ( require ( go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/exporters/prometheus v0.21.0 - go.opentelemetry.io/otel/metric v0.21.0 - go.opentelemetry.io/otel/sdk/export/metric v0.21.0 - go.opentelemetry.io/otel/sdk/metric v0.21.0 + go.opentelemetry.io/otel/exporters/prometheus v0.22.0 + go.opentelemetry.io/otel/metric v0.22.0 + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 + go.opentelemetry.io/otel/sdk/metric v0.22.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus diff --git a/exporters/otlp/otlpmetric/go.mod b/exporters/otlp/otlpmetric/go.mod index e8ee4a5345b..5cc896088d6 100644 --- a/exporters/otlp/otlpmetric/go.mod +++ b/exporters/otlp/otlpmetric/go.mod @@ -6,10 +6,10 @@ require ( github.com/cenkalti/backoff/v4 v4.1.1 github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/metric v0.21.0 + go.opentelemetry.io/otel/metric v0.22.0 go.opentelemetry.io/otel/sdk v1.0.0-RC1 - go.opentelemetry.io/otel/sdk/export/metric v0.21.0 - go.opentelemetry.io/otel/sdk/metric v0.21.0 + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 + go.opentelemetry.io/otel/sdk/metric v0.22.0 go.opentelemetry.io/proto/otlp v0.9.0 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 google.golang.org/grpc v1.39.0 diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod index 5eb84f22b04..83f6b516bb5 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod @@ -5,9 +5,9 @@ go 1.15 require ( github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.21.0 - go.opentelemetry.io/otel/metric v0.21.0 - go.opentelemetry.io/otel/sdk/metric v0.21.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.22.0 + go.opentelemetry.io/otel/metric v0.22.0 + go.opentelemetry.io/otel/sdk/metric v0.22.0 go.opentelemetry.io/proto/otlp v0.9.0 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 google.golang.org/grpc v1.39.0 diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod b/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod index 4646cb42145..cb2ce68ade5 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.21.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.22.0 go.opentelemetry.io/proto/otlp v0.9.0 google.golang.org/protobuf v1.27.1 ) diff --git a/exporters/otlp/otlptrace/internal/tracetransform/span.go b/exporters/otlp/otlptrace/internal/tracetransform/span.go index 5e455204a42..d6ac6377ed2 100644 --- a/exporters/otlp/otlptrace/internal/tracetransform/span.go +++ b/exporters/otlp/otlptrace/internal/tracetransform/span.go @@ -132,10 +132,12 @@ func span(sd tracesdk.ReadOnlySpan) *tracepb.Span { func status(status codes.Code, message string) *tracepb.Status { var c tracepb.Status_StatusCode switch status { + case codes.Ok: + c = tracepb.Status_STATUS_CODE_OK case codes.Error: c = tracepb.Status_STATUS_CODE_ERROR default: - c = tracepb.Status_STATUS_CODE_OK + c = tracepb.Status_STATUS_CODE_UNSET } return &tracepb.Status{ Code: c, diff --git a/exporters/otlp/otlptrace/internal/tracetransform/span_test.go b/exporters/otlp/otlptrace/internal/tracetransform/span_test.go index cd0f8feff2f..62b7cc161f7 100644 --- a/exporters/otlp/otlptrace/internal/tracetransform/span_test.go +++ b/exporters/otlp/otlptrace/internal/tracetransform/span_test.go @@ -169,7 +169,11 @@ func TestStatus(t *testing.T) { { codes.Unset, "test Unset", - tracepb.Status_STATUS_CODE_OK, + tracepb.Status_STATUS_CODE_UNSET, + }, + { + message: "default code is unset", + otlpStatus: tracepb.Status_STATUS_CODE_UNSET, }, { codes.Error, diff --git a/exporters/prometheus/go.mod b/exporters/prometheus/go.mod index 2c5a4d9ac52..143a5a91494 100644 --- a/exporters/prometheus/go.mod +++ b/exporters/prometheus/go.mod @@ -6,10 +6,10 @@ require ( github.com/prometheus/client_golang v1.11.0 github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/metric v0.21.0 + go.opentelemetry.io/otel/metric v0.22.0 go.opentelemetry.io/otel/sdk v1.0.0-RC1 - go.opentelemetry.io/otel/sdk/export/metric v0.21.0 - go.opentelemetry.io/otel/sdk/metric v0.21.0 + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 + go.opentelemetry.io/otel/sdk/metric v0.22.0 ) replace go.opentelemetry.io/otel => ../.. diff --git a/exporters/stdout/stdoutmetric/go.mod b/exporters/stdout/stdoutmetric/go.mod index 5609d8a47f2..9656d5bc650 100644 --- a/exporters/stdout/stdoutmetric/go.mod +++ b/exporters/stdout/stdoutmetric/go.mod @@ -10,10 +10,10 @@ replace ( require ( github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/metric v0.21.0 + go.opentelemetry.io/otel/metric v0.22.0 go.opentelemetry.io/otel/sdk v1.0.0-RC1 - go.opentelemetry.io/otel/sdk/export/metric v0.21.0 - go.opentelemetry.io/otel/sdk/metric v0.21.0 + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 + go.opentelemetry.io/otel/sdk/metric v0.22.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../../bridge/opencensus diff --git a/internal/metric/go.mod b/internal/metric/go.mod index a00bde57bc1..75512cd556f 100644 --- a/internal/metric/go.mod +++ b/internal/metric/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/metric v0.21.0 + go.opentelemetry.io/otel/metric v0.22.0 ) replace go.opentelemetry.io/otel => ../.. diff --git a/metric/go.mod b/metric/go.mod index cd809aac206..c884cabde8d 100644 --- a/metric/go.mod +++ b/metric/go.mod @@ -46,7 +46,7 @@ require ( github.com/google/go-cmp v0.5.6 github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/internal/metric v0.21.0 + go.opentelemetry.io/otel/internal/metric v0.22.0 ) replace go.opentelemetry.io/otel/example/passthrough => ../example/passthrough diff --git a/sdk/export/metric/go.mod b/sdk/export/metric/go.mod index 01b079bcb3d..de45c5d0b66 100644 --- a/sdk/export/metric/go.mod +++ b/sdk/export/metric/go.mod @@ -45,7 +45,7 @@ replace go.opentelemetry.io/otel/trace => ../../../trace require ( github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/metric v0.21.0 + go.opentelemetry.io/otel/metric v0.22.0 go.opentelemetry.io/otel/sdk v1.0.0-RC1 ) diff --git a/sdk/metric/go.mod b/sdk/metric/go.mod index 50da28b18d0..c5d98f016b3 100644 --- a/sdk/metric/go.mod +++ b/sdk/metric/go.mod @@ -46,10 +46,10 @@ require ( github.com/benbjohnson/clock v1.1.0 // do not upgrade to v1.1.x because it would require Go >= 1.15 github.com/stretchr/testify v1.7.0 go.opentelemetry.io/otel v1.0.0-RC1 - go.opentelemetry.io/otel/internal/metric v0.21.0 - go.opentelemetry.io/otel/metric v0.21.0 + go.opentelemetry.io/otel/internal/metric v0.22.0 + go.opentelemetry.io/otel/metric v0.22.0 go.opentelemetry.io/otel/sdk v1.0.0-RC1 - go.opentelemetry.io/otel/sdk/export/metric v0.21.0 + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 ) replace go.opentelemetry.io/otel/example/passthrough => ../../example/passthrough diff --git a/sdk/trace/span.go b/sdk/trace/span.go index da18e62c0e5..722f354762f 100644 --- a/sdk/trace/span.go +++ b/sdk/trace/span.go @@ -262,11 +262,13 @@ func (s *span) End(options ...trace.SpanEndOption) { } s.mu.Unlock() - sps, ok := s.tracer.provider.spanProcessors.Load().(spanProcessorStates) - mustExportOrProcess := ok && len(sps) > 0 - if mustExportOrProcess { + if sps, ok := s.tracer.provider.spanProcessors.Load().(spanProcessorStates); ok { + if len(sps) == 0 { + return + } + snap := s.snapshot() for _, sp := range sps { - sp.sp.OnEnd(s.snapshot()) + sp.sp.OnEnd(snap) } } } diff --git a/versions.yaml b/versions.yaml index 536ee772f2c..05461d94f93 100644 --- a/versions.yaml +++ b/versions.yaml @@ -32,11 +32,12 @@ module-sets: - go.opentelemetry.io/otel/trace - go.opentelemetry.io/otel/sdk experimental-metrics: - version: v0.21.0 + version: v0.22.0 modules: - go.opentelemetry.io/otel/example/prometheus - go.opentelemetry.io/otel/exporters/otlp/otlpmetric - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc + - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp - go.opentelemetry.io/otel/exporters/prometheus - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric - go.opentelemetry.io/otel/internal/metric