-
Notifications
You must be signed in to change notification settings - Fork 826
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance AWS SDK Instrumentation with Detailed HTTP Error Information (#…
- Loading branch information
Showing
10 changed files
with
368 additions
and
7 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
25 changes: 25 additions & 0 deletions
25
...umentation/aws-sdk/aws-sdk-2.2/javaagent/src/test/java/Aws2ClientRecordHttpErrorTest.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,25 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import io.opentelemetry.instrumentation.awssdk.v2_2.AbstractAws2ClientRecordHttpErrorTest; | ||
import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension; | ||
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; | ||
|
||
public class Aws2ClientRecordHttpErrorTest extends AbstractAws2ClientRecordHttpErrorTest { | ||
@RegisterExtension | ||
private final AgentInstrumentationExtension testing = AgentInstrumentationExtension.create(); | ||
|
||
@Override | ||
public ClientOverrideConfiguration.Builder createOverrideConfigurationBuilder() { | ||
return ClientOverrideConfiguration.builder(); | ||
} | ||
|
||
@Override | ||
protected InstrumentationExtension getTesting() { | ||
return testing; | ||
} | ||
} |
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
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
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
37 changes: 37 additions & 0 deletions
37
...t/java/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientNotRecordHttpErrorTest.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,37 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.awssdk.v2_2; | ||
|
||
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; | ||
import io.opentelemetry.instrumentation.testing.junit.LibraryInstrumentationExtension; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; | ||
|
||
public class Aws2ClientNotRecordHttpErrorTest extends AbstractAws2ClientRecordHttpErrorTest { | ||
@RegisterExtension | ||
public final LibraryInstrumentationExtension testing = LibraryInstrumentationExtension.create(); | ||
|
||
@Override | ||
public ClientOverrideConfiguration.Builder createOverrideConfigurationBuilder() { | ||
return ClientOverrideConfiguration.builder() | ||
.addExecutionInterceptor( | ||
AwsSdkTelemetry.builder(testing.getOpenTelemetry()) | ||
.setCaptureExperimentalSpanAttributes(true) | ||
.setRecordIndividualHttpError(isRecordIndividualHttpErrorEnabled()) | ||
.build() | ||
.newExecutionInterceptor()); | ||
} | ||
|
||
@Override | ||
public boolean isRecordIndividualHttpErrorEnabled() { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected InstrumentationExtension getTesting() { | ||
return testing; | ||
} | ||
} |
Oops, something went wrong.