원클릭으로
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) |