Skip to content

bedrock instrumentation#82

Open
Andrew Kent (realark) wants to merge 5 commits intomainfrom
ark/bedrock-instrumentation
Open

bedrock instrumentation#82
Andrew Kent (realark) wants to merge 5 commits intomainfrom
ark/bedrock-instrumentation

Conversation

@realark
Copy link
Copy Markdown
Collaborator

@realark Andrew Kent (realark) commented Apr 17, 2026

bedrock instrumentation

instrumentation also tested against new llm span spec tests: braintrustdata/braintrust-spec#12

@realark Andrew Kent (realark) force-pushed the ark/bedrock-instrumentation branch 2 times, most recently from bab8b95 to bfbc715 Compare April 17, 2026 22:10
@realark Andrew Kent (realark) force-pushed the ark/bedrock-instrumentation branch 4 times, most recently from 472bba1 to 8e03cc3 Compare April 20, 2026 17:29
@realark Andrew Kent (realark) marked this pull request as ready for review April 20, 2026 17:29
@realark Andrew Kent (realark) force-pushed the ark/bedrock-instrumentation branch from 8e03cc3 to afc157d Compare April 20, 2026 17:58
log.debug("Failed to capture response body", e);
}
}
return body;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on error, this will return a half consumed input stream right? So I guess that makes it unsafe. Should we just propagate the exception then?

}

@Override
public void beforeExecution(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we gate by operationName so we don't run this on every single span?

testRuntimeOnly "org.slf4j:slf4j-simple:${slf4jVersion}"
testImplementation "software.amazon.awssdk:bedrockruntime:${awsBedrockVersion}"
testImplementation "software.amazon.awssdk:netty-nio-client:${awsBedrockVersion}"
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to hardcode jackson-databind version?

* Rewrites the Host header to the real AWS hostname so SigV4 signing is valid even when the
* request is sent to the local WireMock proxy via endpointOverride.
*/
private static class HostRewriteInterceptor implements ExecutionInterceptor {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is duplicated with btx/src/test/java/dev/braintrust/sdkspecimpl/SpecExecutor.java. Should we DRY?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants