ai-observability
Observability for Bedrock AI calls: EMF metrics (BedrockTokensIn, BedrockTokensOut, BedrockLatencyMs), X-Ray subsegments per model call, cost dimension…
Skill by Cloud-Byte-Consulting
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/cloud-byte-consulting-ai-observability
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, finance, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/ai-observability
What's inside
- Skill name
ai-observability- Description
- Observability for Bedrock AI calls: EMF metrics (BedrockTokensIn, BedrockTokensOut, BedrockLatencyMs), X-Ray subsegments per model call, cost dimension tracking by agent and model, daily budget monitoring, and structured logging for AI pipelines. Use when instrumenting Bedrock calls or debugging AI pipeline performance.
- License
- BSD-3-Clause
- Instructions
- 171 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
<!-- Vendored from: platform-catalyst/skills/ai-observability/SKILL.md (BittahCriminal/platform-catalyst, BSD-3-Clause). Adapted for Catalyst: PLAN.md/CLAUDE.md/DECISIONS.md scrubbed; ADR-008->ADR-001, ADR-009->ADR-002. -->
# AI observability
## Role
You guide the instrumentation of Bedrock API calls in Catalyst with EMF metrics, X-Ray traces, and structured logs per `AGENTS.md` requirements and *Observability in the AI-Native Era* (Lipsig et al., Ch 1-3: observability pillars, Ch 7-8: AIOps).
## Instructions
### 1. Mandatory per-call EMF metrics (from AGENTS.md)
Every Bedrock Converse call MUST emit:
```python
from aws_lambda_powertools import Metrics
from aws_lambda_powertools.metrics import MetricUnit
import time
import structlog
logger = structlog.get_logger()
metrics = Metrics(namespace="Catalyst", service="pr-reviewer")
async def instrumented_converse(
client: BedrockClient,
model: BedrockModel,
system_prompt: str,
user_message: str,
agent_name: str,
**kwargs,
) -> dict:
"""Bedrock Converse with mandatory EMF metrics."""
start = time.monotonic()
try:
response = await client.converse(model, system_prompt, user_message, **kwargs)
latency_ms = (time.monotonic() - start) * 1000
usage = extract_usage(response)
# EMF metrics — dimensioned by Agent and Model
metrics.add_dimension(name="Agent", value=agent_name)
metrics.add_dimension(name="Model", value=model.value)
metrics.add_metric(name="BedrockTokensIn", unit=MetricUnit.Count, value=usage["input_tokens"])
metrics.add_metric(name="BedrockTokensOut", unit=MetricUnit.Count, value=usage["output_tokens"])
metrics.add_metric(name="BedrockLatencyMs", unit=MetricUnit.Milliseconds, value=latency_ms)
metrics.add_metric(name="BedrockCallSuccess", unit=MetricUnit.Count, value=1)
# Structured log
logger.info("bedrock_call_complete",
agent=agent_name,
model=model.value,
input_tokens=usage["input_tokens"],
output_tokens=usage["output_tokens"],
latency_ms=round(latency_ms, 1),
)
return response
except Exception as e:
latency_ms = (time.monotonic() - start) * 1000
metrics.add_dimension(name="Agent", value=agent_name)
metrics.add_dimension(name="Model", value=model.value)
metrics.add_metric(name="BedrockCallError", unit=MetricUnit.Count, value=1)
metrics.add_metric(name="BedrockLatencyMs", unit=MetricUnit.Milliseconds, value=latency_ms)
logger.error("bedrock_call_failed",
agent=agent_name, model=model.value,
error_type=type(e).__name__, error=str(e),
latency_ms=round(latency_ms, 1),
)
raise
```
### 2. X-Ray subsegments
```python
from aws_xray_sdk.core import xray_recorder
@xray_recorder.capture_async("bedrock_converse")
async def traced_converse(client, model, system_prompt, user_message, agent_name):
subsegment = xray_recorder.current_subsegment()
subsegment.put_annotation("agent", agent_name)
subsegment.put_annotation("model", model.value)
response = await instrumented_converse(client, model, system_prompt, user_message, agent_name)
usage = extract_usage(response)
subsegment.put_metadata("token_usage", usage)
return response
```
### 3. Cost tracking
Per *Observability in the AI-Native Era* Ch 7 (AI cost monitoring):
```python
# Approximate cost per 1K tokens (update when pricing changes)
COST_PER_1K_TOKENS = {
BedrockModel.SONNET: {"input": 0.003, "output": 0.015},
BedrockModel.HAIKU: {"input": 0.0008, "output": 0.004},
}
def estimate_cost(model: BedrockModel, usage: dict) -> float:
"""Estimate USD cost for a single Bedrock call."""
rates = COST_PER_1K_TOKENS[model]
input_cost = (usage["input_tokens"] / 1000) * rates["input"]
output_cost = (usage["output_tokens"] / 1000) * rates["output"]
return round(input_cost + output_cost, 6)
```
Emit cost as an EMF metric:
```python
metrics.add_metric(name="BedrockEstimatedCostUSD", unit=MetricUnit.Count, value=cost)
```
### 4. Daily budget monitoring
The `budget-exhausted` modifier label in the state machine (`docs/ADR/STATE-MACHINE.md`) fires when the daily token budget is exceeded:From Cloud-Byte-Consulting/Catalyst, BSD-3-Clause.
More from Cloud-Byte-Consulting/Catalyst
- 0.474score
bedrock-converse-client
Cloud-Byte-Consulting
Bedrock runtime Converse/ConverseStream API patterns: message structure, model ID selection, token limits, system prompts, retry with tenacity, error…
SkillCFreshness: CClaude Code +9 - 0.474score
ai-output-validation
Cloud-Byte-Consulting
Pydantic v2 schemas for AI model responses: FindingsReport, StyleReport, SynthesisReport, the parse-retry-drop pattern, confidence scoring, and structured…
SkillCFreshness: CClaude Code +9 - 0.474score
bedrock-binding
Cloud-Byte-Consulting
Bedrock model binding for the Catalyst PR reviewer pipeline, surfaced as a thin stdio MCP server with two tools: bedrock_invoke_converse and…
SkillCFreshness: CClaude Code +9 - 0.474score
fastapi-control-plane
Cloud-Byte-Consulting
FastAPI service patterns for catalyst-api: router organization, pydantic v2 request/response models, construct-scoped path design, IAM auth middleware…
SkillCFreshness: CClaude Code +9 - 0.474score
git-commit-practices
Cloud-Byte-Consulting
Git commit and branch practices for Catalyst that satisfy the challenge's "good Git practices" requirement and the 10% docs/commit-history evaluation…
SkillCFreshness: CClaude Code +9 - 0.474score
async-orchestration
Cloud-Byte-Consulting
Event-driven orchestration patterns for Catalyst: SQS FIFO with dedup, EventBridge rules and schedules, DLQ strategies, Step Functions state machines, retry…
SkillCFreshness: CClaude Code +9 - 0.474score
adr-writer
Cloud-Byte-Consulting
MADR-format Architectural Decision Records: context, decision drivers, considered options with pros/cons, decision outcome, consequences, and the supersedes…
SkillCFreshness: CClaude Code +9 - 0.474score
checkov-cloud-image-static-analysis
Cloud-Byte-Consulting
Designs Checkov-based static analysis for Terraform/OpenTofu IaC and Dockerfile/container hardening in Catalyst.
SkillCFreshness: CClaude Code +9 - 0.474score
clean-python-code
Cloud-Byte-Consulting
Maintainable Python for Catalyst: tooling discipline, idiomatic patterns, separation of concerns, SOLID boundaries, thin decorators, pragmatic use of advanced…
SkillCFreshness: CClaude Code +9 - 0.474score
container-hardening
Cloud-Byte-Consulting
Multi-stage Dockerfiles, distroless final images, non-root USER, read-only root filesystem, health checks, no :latest tags, vulnerability scanning, and ECS…
SkillCFreshness: CClaude Code +9 - 0.474score
deployment-strategies
Cloud-Byte-Consulting
Blue/green ECS via CodeDeploy, Lambda weighted alias shifting (canary), rollback triggers (alarm-based), pre/post traffic hooks, bake periods, and the…
SkillCFreshness: CClaude Code +9 - 0.474score
devsecops-integration
Cloud-Byte-Consulting
Shift-left security in Catalyst's CI/CD pipelines: SBOM generation, dependency scanning (pip-audit, npm audit, govulncheck), secret scanning (gitleaks…
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 57
- Last commit (this folder)
- May 21, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- BSD-3-Clause
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Cloud-Byte-Consulting
- 0.474score
clean-python-code
Cloud-Byte-Consulting
Maintainable Python for Catalyst: tooling discipline, idiomatic patterns, separation of concerns, SOLID boundaries, thin decorators, pragmatic use of advanced…
SkillCFreshness: CClaude Code +9 - 0.474score
bedrock-binding
Cloud-Byte-Consulting
Bedrock model binding for the Catalyst PR reviewer pipeline, surfaced as a thin stdio MCP server with two tools: bedrock_invoke_converse and…
SkillCFreshness: CClaude Code +9 - 0.474score
ai-output-validation
Cloud-Byte-Consulting
Pydantic v2 schemas for AI model responses: FindingsReport, StyleReport, SynthesisReport, the parse-retry-drop pattern, confidence scoring, and structured…
SkillCFreshness: CClaude Code +9 - 0.474score
adr-writer
Cloud-Byte-Consulting
MADR-format Architectural Decision Records: context, decision drivers, considered options with pros/cons, decision outcome, consequences, and the supersedes…
SkillCFreshness: CClaude Code +9 - 0.474score
checkov-cloud-image-static-analysis
Cloud-Byte-Consulting
Designs Checkov-based static analysis for Terraform/OpenTofu IaC and Dockerfile/container hardening in Catalyst.
SkillCFreshness: CClaude Code +9 - 0.474score
container-hardening
Cloud-Byte-Consulting
Multi-stage Dockerfiles, distroless final images, non-root USER, read-only root filesystem, health checks, no :latest tags, vulnerability scanning, and ECS…
SkillCFreshness: CClaude Code +9
Cite this page
ai-observability skill. Agent Mart. https://agentmart.dev/skills/cloud-byte-consulting-ai-observability (last updated 2026-10-24)