-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SpanProcessor OnEnding callback (#6367)
Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
313 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/ExtendedSpanProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.trace.internal; | ||
|
||
import io.opentelemetry.api.trace.Span; | ||
import io.opentelemetry.sdk.trace.ReadWriteSpan; | ||
import io.opentelemetry.sdk.trace.ReadableSpan; | ||
import io.opentelemetry.sdk.trace.SpanProcessor; | ||
|
||
/** | ||
* Extended {@link SpanProcessor} with experimental APIs. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public interface ExtendedSpanProcessor extends SpanProcessor { | ||
|
||
/** | ||
* Called when a {@link io.opentelemetry.api.trace.Span} is ended, but before {@link | ||
* SpanProcessor#onEnd(ReadableSpan)} is invoked with an immutable variant of this span. This | ||
* means that the span will still be mutable. Note that the span will only be modifiable | ||
* synchronously from this callback, concurrent modifications from other threads will be | ||
* prevented. Only called if {@link Span#isRecording()} returns true. | ||
* | ||
* <p>This method is called synchronously on the execution thread, should not throw or block the | ||
* execution thread. | ||
* | ||
* @param span the {@code Span} that is just about to be ended. | ||
*/ | ||
void onEnding(ReadWriteSpan span); | ||
|
||
/** | ||
* Returns {@code true} if this {@link SpanProcessor} requires onEnding events. | ||
* | ||
* @return {@code true} if this {@link SpanProcessor} requires onEnding events. | ||
*/ | ||
boolean isOnEndingRequired(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.