Skip to content

Conversation

liustve
Copy link

@liustve liustve commented Oct 7, 2025

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

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

Copy link

linux-foundation-easycla bot commented Oct 7, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@liustve liustve force-pushed the bedrock-agentcore-sem-conv branch 2 times, most recently from c15093f to 7391daf Compare October 7, 2025 19:39
Copy link
Contributor

@thompson-tomo thompson-tomo left a 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.

Comment on lines 632 to 637
- id: aws.bedrock.agentcore.code_interpreter.id
type: string
stability: development
brief: >
The unique identifier of the created code interpreter.
examples: ["myInterpreter-a1b2c3d4e5"]
Copy link
Contributor

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?

Copy link
Author

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.

Comment on lines 644 to 649
- id: aws.bedrock.agentcore.browser.id
type: string
stability: development
brief: >
The unique identifier of the created browser.
examples: ["myBrowser-a1b2c3d4e5"]
Copy link
Contributor

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?

Copy link
Author

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.

Comment on lines 656 to 661
- id: aws.bedrock.agentcore.gateway.id
type: string
stability: development
brief: >
The unique identifier of the created gateway.
examples: ["mygateway-a1b2c3d4e5"]
Copy link
Contributor

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?

Copy link
Author

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.

Comment on lines 590 to 595
- id: aws.bedrock.agentcore.runtime.id
type: string
stability: development
brief: >
The unique identifier of the AgentCore Runtime.
examples: ["myRuntime-a1b2c3d4e5"]
Copy link
Contributor

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?

Copy link
Author

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.

Comment on lines 620 to 625
- id: aws.bedrock.agentcore.memory.id
type: string
stability: development
brief: >
The unique identifier of the memory.
examples: ["myMemory-a1b2c3d4e5"]
Copy link
Contributor

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?

Copy link
Author

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.

Comment on lines 602 to 607
- 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"]
Copy link
Contributor

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?

Copy link
Author

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/

Copy link
Contributor

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/

Copy link
Author

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?

@liustve liustve requested a review from a team as a code owner October 8, 2025 18:41
@liustve liustve changed the title Add new AWS Attributes for Bedrock AgentCore services #1794 Add new AWS Attributes for Bedrock AgentCore services Oct 8, 2025
@liustve
Copy link
Author

liustve commented Oct 8, 2025

It would be helpful to understand where these attributes would be used especially the identity attributes.

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

@thompson-tomo
Copy link
Contributor

@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.

@liustve
Copy link
Author

liustve commented Oct 9, 2025

@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 span.gen_ai.infrastructure attributes and updated aws-bedrock.md with AgentCore attributes to extend them.

liustve added a commit to aws-observability/aws-otel-python-instrumentation that referenced this pull request Oct 16, 2025
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants