agentcore_cli.utils.observability
agentcore_cli.utils.observability
¶
Observability utilities for AgentCore Platform CLI.
This module provides utilities for setting up and managing AWS observability features including CloudWatch Transaction Search for cost-effective tracing.
TransactionSearchManager
¶
Manages AWS CloudWatch Transaction Search configuration.
Source code in agentcore_cli/utils/observability.py
Python | |
---|---|
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
__init__(region)
¶
Initialize the Transaction Search manager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
region
|
str
|
AWS region to operate in |
required |
Source code in agentcore_cli/utils/observability.py
configure_indexing_rule(sampling_percentage=1.0)
¶
Configure the span indexing rule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sampling_percentage
|
float
|
Percentage of spans to index (default 1.0 for free tier) |
1.0
|
Returns:
Type | Description |
---|---|
bool
|
True if indexing rule was configured successfully, False otherwise |
Source code in agentcore_cli/utils/observability.py
configure_trace_destination()
¶
Configure X-Ray to send traces to CloudWatch Logs.
Returns:
Type | Description |
---|---|
bool
|
True if destination was configured successfully, False otherwise |
Source code in agentcore_cli/utils/observability.py
create_resource_policy()
¶
Create the resource policy for X-Ray to send traces to CloudWatch Logs.
Returns:
Type | Description |
---|---|
bool
|
True if policy was created successfully, False otherwise |
Source code in agentcore_cli/utils/observability.py
enable_transaction_search(sampling_percentage=1.0)
¶
Enable Transaction Search with all required configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sampling_percentage
|
float
|
Percentage of spans to index (default 1.0 for free tier) |
1.0
|
Returns:
Type | Description |
---|---|
bool
|
True if Transaction Search was enabled successfully, False otherwise |
Source code in agentcore_cli/utils/observability.py
is_transaction_search_enabled()
¶
Check if Transaction Search is enabled.
Returns:
Type | Description |
---|---|
tuple[bool, str | None]
|
Tuple of (is_enabled, status_message) |
Source code in agentcore_cli/utils/observability.py
get_transaction_search_status(region='us-west-2')
¶
Get detailed Transaction Search status information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
region
|
str
|
AWS region to check |
'us-west-2'
|
Returns:
Type | Description |
---|---|
dict[str, str | bool | None]
|
Dictionary with status information |
Source code in agentcore_cli/utils/observability.py
validate_and_enable_transaction_search(region='us-west-2', interactive=True)
¶
Validate Transaction Search status and enable if needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
region
|
str
|
AWS region to check/configure |
'us-west-2'
|
interactive
|
bool
|
Whether to prompt user for confirmation |
True
|
Returns:
Type | Description |
---|---|
bool
|
True if Transaction Search is enabled (or was enabled successfully), False otherwise |