-
Notifications
You must be signed in to change notification settings - Fork 273
Add new AWS Attributes for Bedrock AgentCore services #2886
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
c15093f to
7391daf
Compare
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.
It would be helpful to understand where these attributes would be used especially the identity attributes.
model/aws/registry.yaml
Outdated
| - id: aws.bedrock.agentcore.code_interpreter.id | ||
| type: string | ||
| stability: development | ||
| brief: > | ||
| The unique identifier of the created code interpreter. | ||
| examples: ["myInterpreter-a1b2c3d4e5"] |
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.
Should this not be gen_ai.code_interpreter.id as code interpreter is not only an aws bedrock concept?
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.
Sure, that makes sense to me. Will make changes.
model/aws/registry.yaml
Outdated
| - id: aws.bedrock.agentcore.browser.id | ||
| type: string | ||
| stability: development | ||
| brief: > | ||
| The unique identifier of the created browser. | ||
| examples: ["myBrowser-a1b2c3d4e5"] |
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.
Should this not be gen_ai.browser.id as browser is not only an aws bedrock concept?
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.
Sure, that makes sense to me. Will make changes.
model/aws/registry.yaml
Outdated
| - id: aws.bedrock.agentcore.gateway.id | ||
| type: string | ||
| stability: development | ||
| brief: > | ||
| The unique identifier of the created gateway. | ||
| examples: ["mygateway-a1b2c3d4e5"] |
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.
Should this not be gen_ai.gateway.id as gateway is not only an aws bedrock concept?
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.
Sure, that makes sense to me. Will make changes.
model/aws/registry.yaml
Outdated
| - id: aws.bedrock.agentcore.runtime.id | ||
| type: string | ||
| stability: development | ||
| brief: > | ||
| The unique identifier of the AgentCore Runtime. | ||
| examples: ["myRuntime-a1b2c3d4e5"] |
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.
Should this not be gen_ai.runtime.id as runtime is not only an aws bedrock concept?
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.
Sure, that makes sense to me. Will make changes.
model/aws/registry.yaml
Outdated
| - id: aws.bedrock.agentcore.memory.id | ||
| type: string | ||
| stability: development | ||
| brief: > | ||
| The unique identifier of the memory. | ||
| examples: ["myMemory-a1b2c3d4e5"] |
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.
Should this not be gen_ai.memory.id as memory is not only an aws bedrock concept?
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.
Sure, that makes sense to me. Will make changes.
model/aws/registry.yaml
Outdated
| - id: aws.bedrock.agentcore.identity.credential_provider.arn | ||
| type: string | ||
| stability: development | ||
| brief: > | ||
| The Amazon Resource Name (ARN) of the OAuth2 credential provider. | ||
| examples: ["arn:aws:acps:us-east-1:123456789012:token-vault/my-vault/oauth2credentialprovider/my-provider"] |
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.
Should we not remove bedrock.agentcore from the id so it can be reused by other aws conventions?
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.
That is reasonable, I changed the name to aws.auth.credential_provider.arn since identity is also an AWS service, did not want to make it confusing:
https://aws.amazon.com/identity/
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.
Actually the convention is to include the service if you take a look at https://opentelemetry.io/docs/specs/semconv/registry/attributes/aws/
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.
I think my original idea and interpretation was that credential_provider isn’t limited to just the identity service, other AWS services, like Bedrock AgentCore Identity or IAM, could also make use of this attribute. My intention was to keep it generic under auth so it could apply more broadly across services, since I think calling it Identity would imply that it should only be used for that service. Would it make sense to move this under more general AWS attributes instead?
…ity semantic convention
These attributes would be set by calls to AWS Bedrock AgentCore in botocore instrumentation: AgentCore component ARNs (code_interpreter, browser, memory, runtime, gateway, runtime_endpoint) would be set when agents interact with these services. Example we could capture runtime_endpoint when calls are made to: https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_CreateAgentRuntimeEndpoint.html |
|
@liustve thanks for the changes, it would be good to see how the new attributes could be used in the current bedrock docs https://opentelemetry.io/docs/specs/semconv/gen-ai/aws-bedrock/ for instance is there new span definition for browser spans or are they added to the existing. |
Sure that makes sense, I added new documentation for |
…rvices (#490) *Description of changes:* Patches botocore instrumentor to add span attributes for Bedrock AgentCore control and data plane calls. - Added `_BedrockAgentCoreExtension` to extract telemetry attributes from API parameters - Registered extensions for `bedrock-agentcore` (data plane) and `bedrock-agentcore-control` (control plane) - Added attribute constants for runtime, browser, code interpreter, gateway, memory, and identity resources New semantic conventions based off this PR: open-telemetry/semantic-conventions#2886 Manually tested verified span attributes examples: ``` { "name": "Bedrock AgentCore.InvokeAgentRuntime", "context": { "trace_id": "0x68e9815d69c6335ba2be2c3a0dc9460d", "span_id": "0x7b65fdc962dfe773", "trace_state": "[]" }, "kind": "SpanKind.CLIENT", "parent_id": null, "start_time": "2025-10-10T21:57:49.492869Z", "end_time": "2025-10-10T21:57:50.070664Z", "status": { "status_code": "UNSET" }, "attributes": { "rpc.system": "aws-api", "rpc.service": "Bedrock AgentCore", "rpc.method": "InvokeAgentRuntime", "aws.region": "us-east-1", "server.address": "bedrock-agentcore.us-east-1.amazonaws.com", "server.port": 443, "aws.auth.region": "us-east-1", "aws.auth.account.access_key": "", "aws.bedrock.agentcore.runtime.arn": "arn:aws:bedrock-agentcore:us-east-1:571600841604:runtime/completeAgent-w8slyU6q5M", "aws.request_id": "a4483186-85ba-4879-b83e-99562da78376", "retry_attempts": 0, "http.status_code": 200 }, "events": [], "links": [], "resource": { "attributes": { "telemetry.sdk.language": "python", "telemetry.sdk.name": "opentelemetry", "telemetry.sdk.version": "1.33.1", "service.name": "unknown_service", "telemetry.auto.version": "0.12.1.dev0-aws", "aws.local.service": "UnknownService" }, "schema_url": "" } } ``` ``` { "name": "Bedrock AgentCore.InvokeCodeInterpreter", "context": { "trace_id": "0x68e98228e901936ec8fe3d76839e3da3", "span_id": "0x1751acb67a5b3073", "trace_state": "[]" }, "kind": "SpanKind.CLIENT", "parent_id": null, "start_time": "2025-10-10T22:01:12.522286Z", "end_time": "2025-10-10T22:01:12.691952Z", "status": { "status_code": "UNSET" }, "attributes": { "rpc.system": "aws-api", "rpc.service": "Bedrock AgentCore", "rpc.method": "InvokeCodeInterpreter", "aws.region": "us-east-1", "server.address": "bedrock-agentcore.us-east-1.amazonaws.com", "server.port": 443, "aws.auth.region": "us-east-1", "gen_ai.code_interpreter.id": "agentCodeInterpreter-m9Mvuwkg6j", "aws.request_id": "b9fd2327-edc4-413d-89d7-715ae836ec64", "retry_attempts": 0, "http.status_code": 200 }, "events": [], "links": [], "resource": { "attributes": { "telemetry.sdk.language": "python", "telemetry.sdk.name": "opentelemetry", "telemetry.sdk.version": "1.33.1", "service.name": "unknown_service", "telemetry.auto.version": "0.12.1.dev0-aws", "aws.local.service": "UnknownService" }, "schema_url": "" } } ``` By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: ADOT Patch workflow <[email protected]>
Changes
Add new AWS Attributes for all AWS Bedrock AgentCore services including Runtime, Memory, Identity, Code Interpreter, Gateway, and Browser.
Note: if the PR is touching an area that is not listed in the existing areas, or the area does not have sufficient domain experts coverage, the PR might be tagged as experts needed and move slowly until experts are identified.
Merge requirement checklist
[chore]