Skip to content

Bedrock AgentCore aws_bedrockagentcore_agent_runtime.observability block support #44742

@Geun-Oh

Description

@Geun-Oh

Description

Hi guys.

For now, to enable observability option in AgentCore, we should additionally set new env vars in our generated runtime (since there are dependency of runtime ID).

To avoid unnecessary action, it will be great to add observability block in aws_bedrockagentcore_agent_runtime resource.
While there may be more detailed options to explore, it would be desired to start by adding the basic observability settings first.

It can be done by using runtime ID as a new env var and enable CloudWatch Transaction Search.

example env:

AGENT_OBSERVABILITY_ENABLED=true
OTEL_PYTHON_DISTRO=aws_distro
OTEL_PYTHON_CONFIGURATOR=aws_configurator # required for ADOT Python only
OTEL_RESOURCE_ATTRIBUTES=service.name=<agent-name>,aws.log.group.names=/aws/bedrock-agentcore/runtimes/<agent-id>,cloud.resource_id=<AgentEndpointArn:AgentEndpointName> # endpoint is optional
OTEL_EXPORTER_OTLP_LOGS_HEADERS=x-aws-log-group=/aws/bedrock-agentcore/runtimes/<agent-id>,x-aws-log-stream=runtime-logs,x-aws-metric-namespace=bedrock-agentcore
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_TRACES_EXPORTER=otlp

This issue can be processed when #43424 merged successfully.

Affected Resource(s) or Data Source(s)

  • aws_bedrockagentcore_agent_runtime

Potential Terraform Configuration

resource "aws_bedrockagentcore_agent_runtime" "test" {
    ...
    observability {
        enable = true
        ...
    }
    ...
}

References

https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-configure.html

To enable Cloudwatch Transaction Search:

https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/xray#Client.UpdateTraceSegmentDestination
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/xray#Client.UpdateIndexingRule

Would you like to implement the enhancement?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequests to existing resources that expand the functionality or scope.needs-triageWaiting for first response or review from a maintainer.service/bedrockagentcoreIssues and PRs that pertain to the bedrockagentcore service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions