-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilize ExceptionEventData #6795
Merged
jack-berg
merged 14 commits into
open-telemetry:main
from
vasantteja:stabilize-exception-event-data
Oct 29, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
219ae6f
wip: stabilizing event exception data.
vasantteja e7c0a03
polish: adding api diffs.
vasantteja 015a707
polish: removing the fully qualified class names and refining the cod…
vasantteja b6e5816
polish: adding a missing comment.
vasantteja 9700e01
polish: Update the comment around the class.
vasantteja 661fc17
polish: applying spotless checks.
vasantteja b89292a
polish: removing additional attributes and converting ExceptionEventD…
vasantteja 7cc7162
polish: removing the unwanted initialization for attributes.
vasantteja e5e686c
polish: static instantiation.
vasantteja 131062a
Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/data/Immuta…
vasantteja b084f01
Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/data/Immuta…
vasantteja d2e0cea
Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkSpan.java
vasantteja aefe947
polish: text fixtures and code refinement.
vasantteja 18c2578
Capture exceptin event total added attribute values, remove unused me…
jack-berg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
Comparing source compatibility of opentelemetry-sdk-trace-1.44.0-SNAPSHOT.jar against opentelemetry-sdk-trace-1.43.0.jar | ||
No changes. | ||
+++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.trace.data.ExceptionEventData (not serializable) | ||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a. | ||
+++ NEW INTERFACE: io.opentelemetry.sdk.trace.data.EventData | ||
+++ NEW SUPERCLASS: java.lang.Object | ||
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.trace.data.ExceptionEventData create(long, java.lang.Throwable, io.opentelemetry.api.common.Attributes, int) | ||
+++ NEW METHOD: PUBLIC(+) ABSTRACT(+) java.lang.Throwable getException() |
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
36 changes: 36 additions & 0 deletions
36
sdk/trace/src/main/java/io/opentelemetry/sdk/trace/data/ExceptionEventData.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,36 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.trace.data; | ||
|
||
import io.opentelemetry.api.common.Attributes; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** Data representation of an event for a recorded exception. */ | ||
vasantteja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Immutable | ||
public interface ExceptionEventData extends EventData { | ||
|
||
/** | ||
* Returns a new immutable {@link ExceptionEventData}. | ||
* | ||
* @param epochNanos epoch timestamp in nanos of the {@link ExceptionEventData}. | ||
* @param exception the {@link Throwable exception} of the {@code Event}. | ||
* @param attributes the additional attributes of the {@link ExceptionEventData}. | ||
* @param totalAttributeCount the total number of attributes for this {@code} Event. | ||
* @return a new immutable {@link ExceptionEventData} | ||
*/ | ||
static ExceptionEventData create( | ||
long epochNanos, Throwable exception, Attributes attributes, int totalAttributeCount) { | ||
return ImmutableExceptionEventData.create( | ||
epochNanos, exception, attributes, totalAttributeCount); | ||
} | ||
|
||
/** | ||
* Return the {@link Throwable exception} of the {@link ExceptionEventData}. | ||
* | ||
* @return the {@link Throwable exception} of the {@link ExceptionEventData} | ||
*/ | ||
Throwable getException(); | ||
} |
40 changes: 40 additions & 0 deletions
40
sdk/trace/src/main/java/io/opentelemetry/sdk/trace/data/ImmutableExceptionEventData.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,40 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.trace.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.api.common.Attributes; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** An effectively immutable implementation of {@link ExceptionEventData}. */ | ||
@AutoValue | ||
@Immutable | ||
abstract class ImmutableExceptionEventData implements ExceptionEventData { | ||
|
||
private static final String EXCEPTION_EVENT_NAME = "exception"; | ||
|
||
@Override | ||
public final String getName() { | ||
return EXCEPTION_EVENT_NAME; | ||
} | ||
|
||
/** | ||
* Returns a new immutable {@code Event}. | ||
* | ||
* @param epochNanos epoch timestamp in nanos of the {@code Event}. | ||
* @param exception the {@link Throwable exception} of the {@code Event}. | ||
* @param attributes the additional {@link Attributes} of the {@code Event}. | ||
* @param totalAttributeCount the total number of attributes for this {@code} Event. | ||
* @return a new immutable {@code Event<T>} | ||
*/ | ||
static ExceptionEventData create( | ||
long epochNanos, Throwable exception, Attributes attributes, int totalAttributeCount) { | ||
return new AutoValue_ImmutableExceptionEventData( | ||
attributes, epochNanos, totalAttributeCount, exception); | ||
} | ||
|
||
ImmutableExceptionEventData() {} | ||
} |
51 changes: 0 additions & 51 deletions
51
sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/data/ExceptionEventData.java
This file was deleted.
Oops, something went wrong.
91 changes: 0 additions & 91 deletions
91
...e/src/main/java/io/opentelemetry/sdk/trace/internal/data/ImmutableExceptionEventData.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/data/package-info.java
This file was deleted.
Oops, something went wrong.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍