opensite-ai/opensite-skills / aws-observability
aws-observability
UnverifiedBuilds, configures, debugs, and optimizes AWS observability - operator-symptom questions and detecting Omni vs classic CloudWatch. CloudWatch on an already-reporting service: Log Insights, metric/composite/anomaly alarms, custom metrics/EMF, dashboards, X-Ray/ADOT tracing, canaries, CloudTrail, Dynamic Instrumentation (live breakpoints/snapshots), the Application Signals service map, and fleet health views. CloudWatch Omni on an existing Space: SQL over logs and traces, PromQL over metrics, Omni dashboards, Omni alerts, context graph for root cause, programmatic/IaC access (API/SDK/CLI/CloudFormation), driving Omni from a coding agent or skills, and evaluating AI agent quality from traces - on-demand and online scoring of live traffic, readback, custom evaluators. For first-time setup - creating an Omni Space, granting access, ingestion, or ADOT instrumentation for Application Signals (ServiceEvents, CI/CD metadata) or Omni - use setting-up-cloudwatch-observability. Not for app logging or threat detection.
scripts/cloudwatch/di_snapshot_queries.py
View on GitHub"""CloudWatch Logs Insights query helpers for snapshot tools."""
import time
import di_logs_client as aws_clients
from botocore.exceptions import BotoCoreError, ClientError
def _execute_cloudwatch_query(
query_string: str,
start_epoch: int,
end_epoch: int,
log_group_name: str,
max_timeout: int = 30,
) -> dict:
"""Execute a CloudWatch Logs Insights query and poll for results."""
logs = aws_clients.logs_client
try:
start_response = logs.start_query(
logGroupName=log_group_name,
startTime=start_epoch,
endTime=end_epoch,
queryString=query_string,
)
except ClientError as exc:
return {
"status": "Error",
"error": f"Failed to start query: {exc}",
"results": [],
}
except BotoCoreError as exc:
return {"status": "Error", "error": str(exc), "results": []}
query_id = start_response.get("queryId")
if not query_id:
return {
"status": "Error",
"error": f"start_query did not return a queryId (response: {start_response})",
"results": [],
}
poll_start = time.time()
while poll_start + max_timeout > time.time():
try:
response = logs.get_query_results(queryId=query_id)
except ClientError as exc:
return {
"status": "Error",
"error": f"Failed to get results: {exc}",
"results": [],
"queryId": query_id,
}
except BotoCoreError as exc:
return {
"status": "Error",
"error": str(exc),
"results": [],
"queryId": query_id,
}
status = response.get("status", "Unknown")
if status in {"Complete", "Failed", "Cancelled"}:
results = [
{field.get("field", ""): field.get("value", "") for field in line}
for line in response.get("results", [])
]
return {
"status": status,
"queryId": query_id,
"results": results,
"messages": response.get("messages", []),
}
time.sleep(1)
return {
"status": "Polling Timeout",
"queryId": query_id,
"results": [],
"error": f"Query did not complete within {max_timeout} seconds.",
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |