File tree Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
10
10
11
11
### Added
12
12
13
- - The ` OnEndingSpanProcessor ` in ` go.opentelemetry.io/otel/sdk/trace ` to implement the ` OnEnding ` callback. (#5756 )
13
+ - Support for the ` OnEnding ` callback in span processors . (#5756 )
14
14
15
15
### Removed
16
16
Original file line number Diff line number Diff line change
1
+ // Copyright The OpenTelemetry Authors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ package x // import "go.opentelemetry.io/otel/sdk/internal/x"
5
+
6
+ // OnEndingSpanProcessor represents span processors that allow mutating spans
7
+ // just before they are ended and made immutable.
8
+ type OnEndingSpanProcessor interface {
9
+ // OnEnding is called while the span is finished, and while spans are still
10
+ // mutable. It is called synchronously and cannot block.
11
+ OnEnding (ReadWriteSpan )
12
+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
19
19
"go.opentelemetry.io/otel/codes"
20
20
"go.opentelemetry.io/otel/internal/global"
21
21
"go.opentelemetry.io/otel/sdk/instrumentation"
22
+ "go.opentelemetry.io/otel/sdk/internal/x"
22
23
"go.opentelemetry.io/otel/sdk/resource"
23
24
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
24
25
"go.opentelemetry.io/otel/trace"
@@ -427,7 +428,7 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) {
427
428
428
429
sps := s .tracer .provider .getSpanProcessors ()
429
430
for _ , sp := range sps {
430
- if oesp , ok := sp .sp .(OnEndingSpanProcessor ); ok {
431
+ if oesp , ok := sp .sp .(x. OnEndingSpanProcessor ); ok {
431
432
oesp .OnEnding (s )
432
433
}
433
434
}
Original file line number Diff line number Diff line change @@ -49,17 +49,6 @@ type SpanProcessor interface {
49
49
// must never be done outside of a new major release.
50
50
}
51
51
52
- // OnEndingSpanProcessor represents span processors that allow mutating spans
53
- // just before they are ended and made immutable.
54
- //
55
- // NOT STABLE: This interface still has a status of "development", and may have
56
- // breaking changes.
57
- type OnEndingSpanProcessor interface {
58
- // OnEnding is called while the span is finished, and while spans are still
59
- // mutable. It is called synchronously and cannot block.
60
- OnEnding (ReadWriteSpan )
61
- }
62
-
63
52
type spanProcessorState struct {
64
53
sp SpanProcessor
65
54
state sync.Once
You can’t perform that action at this time.
0 commit comments