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_region.py
View on GitHub"""Region resolution for the dynamic-instrumentation host scripts.
WHY THIS EXISTS
``di_instrumentation.py`` (application-signals client) and ``di_snapshots.py``
(CloudWatch Logs client) both need to pick an AWS region, and they must pick it
the SAME way so a breakpoint created in one region and the snapshots later read
for it land in the same region. Centralizing the policy here keeps the two
host scripts from drifting apart.
POLICY (mirrors boto3's own precedence, minus the profile region)
explicit --region flag > AWS_REGION > AWS_DEFAULT_REGION > us-east-1
* ``AWS_PROFILE`` is honored for CREDENTIALS only (by the client builders); the
profile's configured region is deliberately ignored so the target region is
always explicit and overridable per invocation.
* Both ``AWS_REGION`` and ``AWS_DEFAULT_REGION`` are consulted because boto3
itself honors both; reading only ``AWS_REGION`` would surprise a caller who
set ``AWS_DEFAULT_REGION`` instead.
* The ``us-east-1`` fallback means a call never fails for lack of a region, but
callers are expected to pass ``--region`` or set the env var to target the
region their service actually runs in (see SKILL.md).
The ``--region`` flag is a thin front-end: the host script sets
``AWS_REGION`` from the flag before dispatch, so the existing env-driven client
builders pick it up with no change to operation signatures.
"""
import os
from typing import Optional
DEFAULT_REGION = "us-east-1"
def resolve_region(explicit: Optional[str] = None) -> str:
"""Resolve the AWS region using the documented precedence.
Args:
explicit: A region passed directly (e.g. from a ``--region`` flag).
When falsy, environment variables and the default are consulted.
Returns:
``explicit`` if provided, else ``AWS_REGION``, else
``AWS_DEFAULT_REGION``, else ``us-east-1``.
"""
if explicit:
return explicit
return os.environ.get("AWS_REGION") or os.environ.get("AWS_DEFAULT_REGION") or DEFAULT_REGION
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 |