fastapi-otel-common

FastAPI OTEL Common Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "fastapi-otel-common" with this command: npx skills add devdenvino/fastapi_otel_common/devdenvino-fastapi-otel-common-fastapi-otel-common

FastAPI OTEL Common Skill

This skill provides the AI agent with specialized knowledge and best practices for the fastapi-otel-common ecosystem.

Core Principles

  • Observability First: Always implement OpenTelemetry tracing and metrics. Use the built-in instrumentation.

  • Structured Logging: Use loguru for all logging. Avoid print() . Use the library's logger initialization.

  • Security by Default: Use get_current_user or role-based decorators (RequireRoles ) for protected endpoints.

  • Production-Ready Health Checks: Utilize the automatic /healthz , /readyz , and /livez endpoints.

Common Tasks

  1. Initialize the App

from fastapi_otel_common import create_app

app = create_app( title="My Service", version="1.0.0", # All security headers and OTEL instrumentation are enabled by default )

  1. Add OIDC Protected Route

from fastapi import Depends from fastapi_otel_common.security import get_current_user from fastapi_otel_common.core.models import UserBase

@app.get("/me") async def get_me(user: UserBase = Depends(get_current_user)): return user

  1. Implement Role-Based Access Control

from fastapi_otel_common.security import RequireRoles

@app.post("/admin/action") async def admin_action( user: UserBase = Depends(RequireRoles(["admin"])) ): return {"status": "success"}

  1. Custom Tracing

from opentelemetry import trace

tracer = trace.get_tracer(name)

async def some_logic(): with tracer.start_as_current_span("my-custom-operation"): # Logic here pass

Troubleshooting

  • No Traces in Collector: Check OTEL_EXPORTER_OTLP_ENDPOINT environment variable.

  • DB Connection Issues: Ensure DB_TYPE and associated credentials (e.g., POSTGRES_USER , SQLITE_DB_PATH ) are set.

  • Authentication Fails: Verify OIDC_ISSUER , OIDC_CLIENT_ID , and OIDC_JWKS_URI .

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated
Coding

clawhub-rate-limited-publisher

Queue and publish local skills to ClawHub with a strict 5-per-hour cap using the local clawhub CLI and host scheduler.

Archived SourceRecently Updated