ワンクリックで
python-observability-patterns
Structured logging with structlog. Triggers on: log, logger, exception, structlog, observe, print, logging.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Structured logging with structlog. Triggers on: log, logger, exception, structlog, observe, print, logging.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Hexagonal Architecture (Ports & Adapters) for the video publishing pipeline. Triggers on: VideoPublisher, TrendingVideoFetcher, TimeSeriesReader, VideoMetadataReader, AuthCredentialStore, ReleaseDateValidator, OAuthProvider, publisher_registry, ports, adapters, domain, hexagonal, build_publishers, TaskGroup publish.
Type hint patterns for this repo: Protocol, TypeVar, TypedDict, Literal, Final, and strict ty usage. Triggers on: type hints, typing, TypeVar, Protocol, Generic, TypedDict, ty check.
Design, review, and optimize Dockerfiles, Docker images, and Docker Compose configurations for production, performance, and maintainability. Use when auditing Docker configurations, creating production-ready images, designing multi-container architectures, or implementing container orchestration with focus on security, reproducibility, minimal attack surface, build optimization, and observability.
Best practices for modeling, ingesting, querying, and analyzing time-series data with TinyFlux. Use when designing TinyFlux Point schemas, implementing query patterns, managing retention and partitioning, or integrating TinyFlux with pandas/NumPy for analysis and forecasting workflows.
Video processing migration (C1 split): guidelines for decomposing src/video_processing.py into src/infrastructure/video/. Triggers on: video_processing, VideoAssetManager, VideoRenderer, ThumbnailGenerator, VideoCompositor, moviepy, CompositeVideoClip, PIL Image.
Async resilience, retries, and HTTP client patterns. Triggers on: retry, timeout, HTTP request, rate limit, aiohttp, ClientSession, backoff.
| name | python-observability-patterns |
| description | Structured logging with structlog. Triggers on: log, logger, exception, structlog, observe, print, logging. |
from src.shared.logging import get_logger—it wraps structlog.get_logger().logging.getLogger(), logging.basicConfig(), or bare print().from src.shared.logging import get_logger
logger = get_logger(__name__)
The first positional argument is the event name (dot-separated or underscore). All context goes as keyword arguments — structlog binds them as key-value pairs.
# ❌ BAD
logger.info(f"Published video {video.id} to {platform}")
# ✅ GOOD
logger.info("video.published", video_id=video.id, platform=platform.value, duration_s=14.5)
logger.warning("publish.skipped", reason="already_published_today", platform=platform.value)
Add exc_info=True to include the stack trace. Do not embed str(exc) as the event name.
try:
await publisher.publish(video)
except PublishError as exc:
logger.error(
"publish.failed",
platform=publisher.platform_name,
error=str(exc),
exc_info=True,
)
| ❌ Anti-pattern | ✅ Correct |
|---|---|
logging.getLogger("app") | get_logger(__name__) |
logger.info(f"Processing {id}") | logger.info("processing", id=id) |
print("Done") | logger.info("done") |
logger.error("msg", extra={"key": val}) | logger.error("msg", key=val) |
logger.error(str(exc)) | logger.error("task.failed", error=str(exc), exc_info=True) |