Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 12, 2026·2 min de lecture

Logfire — Python Observability on OpenTelemetry

Logfire is Pydantic’s Python SDK for traces/metrics/logs on OpenTelemetry, helping teams add observability with minimal code and query data with SQL.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Stage only · 29/100Stage only
Surface agent
Tout agent MCP/CLI
Type
Script
Installation
Single
Confiance
Confiance : Established
Point d'entrée
logfire
Commande CLI universelle
npx tokrepo install 67236d34-9663-4f58-a975-0a218f099c6d
Introduction

Logfire is Pydantic’s Python SDK for traces/metrics/logs on OpenTelemetry, helping teams add observability with minimal code and query data with SQL.

  • Best for: Python teams who want quick, consistent observability for apps and agent backends
  • Works with: Python apps (e.g., FastAPI) and OpenTelemetry-compatible backends
  • Setup time: 10–30 minutes

Practical Notes

  • Quant: aim for 1 end-to-end request trace with spans for DB + HTTP within the first hour.
  • Quant: track p95 latency and error rate before vs after adding instrumentation.

Agent backend tip: make tool calls observable

If you run an agent service, the fastest win is instrumenting tool calls:

  • external HTTP requests,
  • database queries,
  • vector search,
  • and model API calls.

Name spans consistently (e.g., tool.http, tool.sql, tool.vector) so you can answer: where did time and failures go?

Data hygiene

Avoid logging secrets. Configure scrubbing/redaction early and review what ends up in traces before enabling in production.

FAQ

Q: Is the whole platform open-source? A: No. This repo is the open-source SDK and docs; the hosted platform is separate.

Q: Can I export to another backend? A: Yes—OpenTelemetry compatibility means you can target other OTel backends if needed.

Q: What should I instrument first? A: Start with request traces + tool calls, then add DB/HTTP client instrumentation.

🙏

Source et remerciements

Source: https://github.com/pydantic/logfire > License: MIT > GitHub stars: 4,236 · forks: 234

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires