-
Notifications
You must be signed in to change notification settings - Fork 833
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stabilize ExceptionEventData (#6795)
Co-authored-by: jack-berg <[email protected]> Co-authored-by: Jack Berg <[email protected]>
- Loading branch information
1 parent
3f05bf6
commit fcae15e
Showing
8 changed files
with
132 additions
and
186 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
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. */ | ||
@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