From observability
Add structured log points and trace spans to existing code. Use this skill when asked to "instrument this function", "add logging to this module", "add tracing to this pipeline", or "make this code observable".
npx claudepluginhub ats-kinoshita-iso/agent-workshop --plugin observabilityThis skill uses the workspace's default tool permissions.
Add structured logging and distributed tracing instrumentation to existing code.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Analyzes competition with Porter's Five Forces, Blue Ocean Strategy, and positioning maps to identify differentiation opportunities and market positioning for startups and pitches.
Add structured logging and distributed tracing instrumentation to existing code.
Read the target file(s) and identify:
Choose based on the project's existing dependencies:
| Language | Recommended library | Install command |
|---|---|---|
| Python | structlog | uv add structlog |
| Python | opentelemetry-sdk | uv add opentelemetry-sdk opentelemetry-exporter-otlp |
| TypeScript | pino | bun add pino |
| TypeScript | @opentelemetry/sdk-node | bun add @opentelemetry/sdk-node |
If the project already imports a logging library, use that — do not add a second one.
For each external-facing function, wrap the body in a trace span:
# Python (structlog + opentelemetry)
import structlog
from opentelemetry import trace
logger = structlog.get_logger(__name__)
tracer = trace.get_tracer(__name__)
def process_request(payload: dict) -> dict:
with tracer.start_as_current_span("process_request") as span:
span.set_attribute("payload.size", len(str(payload)))
logger.info("process_request.start", payload_keys=list(payload.keys()))
result = _do_work(payload)
logger.info("process_request.end", result_keys=list(result.keys()))
return result
Insert log statements at:
Keep log messages machine-readable: use event="snake_case_name" as the primary key.
For every except/catch block, emit a structured error log:
except SomeError as exc:
logger.error(
"process_request.failed",
error=str(exc),
error_type=type(exc).__name__,
exc_info=True,
)
raise
For loops and repeated external calls, record timing and counts:
import time
start = time.perf_counter()
result = call_llm_api(prompt)
duration_ms = (time.perf_counter() - start) * 1000
logger.info("llm_call.complete", duration_ms=round(duration_ms, 1), tokens=result.usage.total_tokens)
Run the test suite after adding instrumentation:
Output the instrumented code as a unified diff, keeping changes minimal. Avoid restructuring logic — instrumentation should be additive only.