-
Notifications
You must be signed in to change notification settings - Fork 26
feat: Add Resource and CFN Attributes for Bedrock AgentCore spans #495
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
base: main
Are you sure you want to change the base?
Conversation
if browser_arn: | ||
resource_identifier = extract_bedrock_agentcore_resource_id_from_arn(str(browser_arn)) | ||
if browser_id: | ||
resource_identifier = str(browser_id) |
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.
Do you always need to check on two if browser_id
value exists?
if browser_arn: | |
resource_identifier = extract_bedrock_agentcore_resource_id_from_arn(str(browser_arn)) | |
if browser_id: | |
resource_identifier = str(browser_id) | |
if browser_id: | |
resource_identifier = str(browser_id) | |
elif browser_arn: | |
resource_identifier = extract_bedrock_agentcore_resource_id_from_arn(str(browser_arn)) |
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.
Or this resource_identifier = str(browser_id)
should be agentcore_cfn_id = str(browser_id)
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.
ack. That makes sense.
resource_identifier = extract_bedrock_agentcore_resource_id_from_arn(str(gateway_arn)) | ||
if gateway_id: | ||
resource_identifier = str(gateway_id) | ||
return "Gateway", resource_identifier, resource_identifier |
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.
Ditto. why you return the resource_identifier
value for both Remote Resource Identifier
and CFN_Identifier
. Seems not correct
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.
The Primary identifier for Gateway is the id:
"primaryIdentifier": [ "/properties/GatewayIdentifier" ],
Description of changes:
Follow up to: #490
Normalizes
AWS::Bedrock AgentCore
andAWS::Bedrock AgentCore Control
from botocore instrumentation toAWS::BedrockAgentCore
Add Resource and CFN attributes for Bedrock AgentCore support as following:
a. Runtime: Extract
agentRuntimeId
or parse fromagentRuntimeArn
and add intoaws.remote.resource.identifier
span attribute.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::Runtime
.b. Runtime Endpoint: Extract endpoint ID from
agentRuntimeEndpointArn
and add intoaws.remote.resource.identifier
span attribute, but use full ARN asaws.cloudformation.primary.identifier
.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::RuntimeEndpoint
.c. Browser: Extract
browserIdentifier
or parse frombrowserArn
, and add intoaws.remote.resource.identifier
span attribute.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::Browser
(foraws.browser.v1
) orAWS::BedrockAgentCore::BrowserCustom
(for custom browsers).d. Gateway: Extract
gatewayId
or parse fromgatewayArn
, and add intoaws.remote.resource.identifier
span attribute.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::Gateway
.e. Gateway Target: Extract
targetId
from span attributes and add intoaws.remote.resource.identifier
span attribute.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::GatewayTarget
. Takes priority over Gateway when present.f. Code Interpreter: Extract
codeInterpreterIdentifier
or parse fromcodeInterpreterArn
, and add intoaws.remote.resource.identifier
span attribute.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::CodeInterpreter
(foraws.codeinterpreter.v1
) orAWS::BedrockAgentCore::CodeInterpreterCustom
(for custom interpreters).g. Memory: Extract
memoryId
or parse frommemoryArn
and add intoaws.remote.resource.identifier
span attribute, but use full ARN asaws.cloudformation.primary.identifier
when available.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::Memory
.h. Identity: Extract provider ID from credential provider ARNs for OAuth2 and API Key credential providers and add into
aws.remote.resource.identifier
span attribute.Set
aws.remote.resource.type
toAWS::BedrockAgentCore::OAuth2CredentialProvider
orAWS::BedrockAgentCore::APIKeyCredentialProvider
.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.