Skip to content
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

support bedrock and bedrock runtime resources #5

Merged
merged 13 commits into from
Jul 9, 2024

Conversation

mxiamxia
Copy link
Owner

@mxiamxia mxiamxia commented Jun 21, 2024

This PR add AWS Bedrock and BedrockRuntime support for AWS Java SDK V2 with the following change:

A. Bedrock:
Extract guardrailId from API response, and add into "aws.bedrock.guardrail.id" span attribute.

B. Bedrock Agent:
Extract agentId from both API request and response, and add into "aws.bedrock.agent.id" span attribute.
Extract knowledgeBaseId from API request, and add into "aws.bedrock.knowledgebase.id" span attribute.
Extract dataSourceId from both API request and response,, and add into "aws.bedrock.datasource.id" span attribute.

The instrumentation is on API operation level, we make sure only one attribute is extracted per API call, there will be no overlap/conflict to identify the resouce.

C. Bedrock Agent Runtime:
Extract agentId from API request, and add into "aws.bedrock.agent.id" span attribute.
Extract knowledgeBaseId from API request, and add into "aws.bedrock.knowledgebase.id" span attribute.

D. Bedrock Runtime:
Extract the following attributes and add into span according to Gen AI semantic-conventions:

gen_ai.request.model
gen_ai.system

Testing: E2E test performed to confirm trace span are generated correctly:
Screenshot 2024-07-08 at 3 56 28 PM
Screenshot 2024-07-08 at 3 58 35 PM
Screenshot 2024-07-08 at 3 59 33 PM
Screenshot 2024-07-08 at 4 01 02 PM
Screenshot 2024-07-08 at 4 03 37 PM

@mxiamxia mxiamxia force-pushed the v1_32_1_dev_bedrock branch from f3139a0 to 2464029 Compare June 21, 2024 04:41
@mxiamxia mxiamxia force-pushed the v1_32_1_dev_bedrock branch from 2464029 to d9030c2 Compare June 21, 2024 21:07
@zzhlogin zzhlogin self-assigned this Jun 26, 2024
@zzhlogin zzhlogin removed their assignment Jun 28, 2024
Copy link
Owner Author

@mxiamxia mxiamxia left a comment

Choose a reason for hiding this comment

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

pls help to address the comment

Copy link

@bjrara bjrara left a comment

Choose a reason for hiding this comment

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

lgtm

@zzhlogin zzhlogin merged commit debb9be into v1_32_1_dev Jul 9, 2024
37 of 46 checks passed
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.

3 participants