litestar-metrics

Instrument Litestar applications with OpenTelemetry metrics for Prometheus-compatible export.

7|1|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/alti3/litestar-skills --skill litestar-metrics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: litestar-metrics
Source: https://github.com/alti3/litestar-skills/tree/main/plugins/litestar/skills/litestar-metrics
Command: npx skills add https://github.com/alti3/litestar-skills --skill litestar-metrics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add Litestar observability metrics via OpenTelemetry and Prometheus-compatible instrumentation, including request latency/error metrics and custom business counters. Use when implementing service-level monitoring and SLO visibility. Do not use for log formatting or exception contract design.

Core Features & Use Cases

  • Instrument request-level metrics (count, duration, error rate) with stable labels.
  • Add domain-specific custom metrics at service boundaries.
  • Validate cardinality and collection overhead before production rollout.
  • Correlate with logs/traces through shared dimensions.

Quick Start

Configure your Litestar app to emit metrics via OpenTelemetry and Prometheus-compatible exporters for monitoring and SLO visibility.

Frequently Asked Questions about litestar-metrics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I instrument Litestar apps for OpenTelemetry and Prometheus metrics?

Instrument Litestar apps for OpenTelemetry metrics by emitting latency, throughput, and error rate data through Prometheus-compatible exporters, applying stable metric naming and low-cardinality labels across API endpoints and background tasks.

How do I track request latency and error rates in Litestar?

Track request latency and error rates in Litestar by instrumenting request-level metrics with stable labels, capturing count and duration data to enable real-time dashboards and alerts for development, staging, and production environments.

Can I add custom business counters at service boundaries in Litestar?

Add custom business counters at service boundaries in Litestar to capture domain-specific metrics, validating cardinality and collection overhead before production rollout to maintain SLO visibility.

How do I correlate Litestar metrics with logs and traces?

Correlate Litestar metrics with logs and traces through shared dimensions, enabling consistent observability across service boundaries for comprehensive service-level monitoring and SLO tracking.

What are the limitations of Litestar observability instrumentation?

Litestar observability instrumentation does not handle log formatting or exception contract design, focusing solely on emitting OpenTelemetry metrics for latency, throughput, error rates, and custom business counters.

Does Litestar metrics instrumentation work with OpenTelemetry pipelines?

Litestar metrics instrumentation works with OpenTelemetry pipelines, satisfying stable metric naming and low-cardinality labels while supporting Prometheus-compatible export pipelines for real-time dashboards and alerts.