Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…y-go into feature/remove_resource_WithBuiltinDetectors_func
  • Loading branch information
hanyuancheung committed Jul 21, 2021
2 parents 2002e65 + 63dfe64 commit 0eaa33c
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 36 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand All @@ -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`
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bridge/opencensus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions example/opencensus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions example/prometheus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions exporters/otlp/otlpmetric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlpmetric/otlpmetrichttp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
4 changes: 3 additions & 1 deletion exporters/otlp/otlptrace/internal/tracetransform/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions exporters/prometheus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 => ../..
Expand Down
6 changes: 3 additions & 3 deletions exporters/stdout/stdoutmetric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/metric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 => ../..
Expand Down
2 changes: 1 addition & 1 deletion metric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sdk/export/metric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
6 changes: 3 additions & 3 deletions sdk/metric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions sdk/trace/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0eaa33c

Please sign in to comment.