observability-architecture
БесплатноБез исполняемых скриптовНе проверенLiteLLM-RS Observability Architecture. Covers the Prometheus-format metrics rendered by the metrics middleware and /metrics endpoint, health/readiness…
от majiayu000★ 124 звезды на GitHubОб этом скилле
Observability Architecture Guide
Overview
Observability in LiteLLM-RS is built from three runtime pieces:
- HTTP metrics —
MetricsMiddleware(src/server/middleware/metrics.rs) counts requests with process-local atomics and renders Prometheus text format on demand. Noprometheuscrate is used; series are hand-rendered and use thegateway_prefix except the standalonerate_limiter_degraded_totalcounter. - Health/status routes —
src/server/routes/health.rsmounts/health,/health/ready,/health/detailed,/status,/version, and/metricson the main HTTP server. - Callback exporters — configured under
monitoring.callbacks, theOpenTelemetryIntegration(OTLP/HTTP JSON),DataDogIntegration, andLangfuseIntegrationreceive real LLM lifecycle events through theCallbackDispatcherstored inAppState(exposed asRuntimeObservability).
┌─────────────────────────────────────────────────────────────────┐
│ LiteLLM Gateway │
├─────────────────────────────────────────────────────────────────┤
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ Metrics │ │ Health/status │ │ Callback │ │
│ │ middleware │ │ routes │ │ dispatcher │ │
│ └───────┬───────┘ └───────┬───────┘ └───────┬───────┘ │
└──────────┼──────────────────┼──────────────────┼───────────────┘
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Prometheus │ │ LB / K8s probes │ │ OTLP / Datadog / │
│ scrapes /metrics │ │ + JSON status │ │ Langfuse backends│
└──────────────────┘ └──────────────────┘ └──────────────────┘
Configuration
The section is monitoring: at the top level of config/gateway.yaml (deserialized as
GatewayConfig.monitoring, src/config/models/gateway.rs). The outer monitoring models
use #[serde(deny_unknown_fields)], but callback backend payloads such as
OpenTelemetryConfig do not all make that guarantee; strictness follows the concrete
deserialized struct.
monitoring:
metrics:
enabled: true # gates MetricsMiddleware (src/server/http.rs)
port: 9090 # default 9090; validated > 0 when enabled
path: "/metrics" # validated non-empty, starts with '/'
interval_seconds: 15
tracing:
enabled: false
endpoint: null # REQUIRED when enabled: true (config validation)
service_name: "litellm-rs"
sampling_rate: 0.1
jaeger: null # or {agent_endpoint, service_name}
health:
path: "/health"
detailed: true
logging: null # or {level, format: text|json|structured, outputs}
callbacks:
queue_capacity: 1024
timeout_ms: 5000
backends: [] # {type: opentelemetry|datadog|langfuse, config: {...}}
Wiring notes (verified against current code):
metrics.enabledis the only metrics key with runtime effect: it wraps the app inCondition::new(metrics_enabled, MetricsMiddleware)(src/server/http.rs). The/metricsroute itself is hardcoded inroutes::health::configure_routes;port,path, andinterval_secondsare parsed and validated but not consumed by runtime wiring today.tracing.enabledonly appears in the startup summary log (src/lib.rs); OTLP trace export is configured throughcallbacks.backends, not thetracing:section.loggingis parsed/validated but the log subscriber is initialized insrc/main.rsinit_loggingfrom the CLI/env level, not from this section.health.pathandhealth.detailedare parsed and validated, but route registration is hardcoded to/health,/health/ready, and/health/detailed; neither field changes the runtime health surface today.
References
- reference/metrics.md — the full
gateway_*metric inventory, how the middleware records, and the /metrics renderer. - reference/tracing-and-logging.md — log subscriber init, request IDs, access-log events, and the OTLP/Datadog/Langfuse callback exporters.
- reference/health-checks.md — health/readiness/detailed endpoints, response models, and the aggregate readiness rule.
- reference/alerting.md — Prometheus alert rules built on real
gateway_*series. - reference/best-practices.md — metric type selection, log context, label cardinality, and graceful telemetry degradation.
Установить observability-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл observability-architecture?
LiteLLM-RS Observability Architecture. Covers the Prometheus-format metrics rendered by the metrics middleware and /metrics endpoint, health/readiness endpoints, request logging, and the OpenTelemetry/Datadog/Langfuse callback exporters. Use when adding or changing metrics or log instrumentation, implementing or debugging health checks, wiring Prometheus alert rules, or configuring the monitoring stack.
Как установить скилл observability-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл observability-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic