Logfire

Logfire

Provides access to OpenTelemetry traces and metrics through Logfire.

127
Stars
23
Forks
14
Releases

Overview

Exposes a set of tools letting language models retrieve telemetry data from OpenTelemetry traces and metrics ingested by Pydantic Logfire. It enables LLMs to access application telemetry, analyze distributed traces, and leverage results from arbitrary SQL queries against the Logfire API. Tools include find_exceptions_in_file (returns details on the 10 most recent exceptions in a file, with timestamp, exception_type, exception_message, function_name, line_number, and trace context, plus attributes and trace_id), arbitrary_query (run a user-provided SQL query within a lookback window defined by age), logfire_link (create a UI link to view a trace by trace_id), and schema_reference (return the Logfire DataFusion database schema). The MCP server is run with uv (uvx logfire-mcp@latest), requiring a LOGFIRE_READ_TOKEN; for self-hosted setups, LOGFIRE_BASE_URL can be specified. It is designed to work with MCP clients (Cursor, Claude, Cline, VS Code, Zed) to empower automated telemetry analysis by language models.

Details

Owner
pydantic
Language
Python
License
MIT License
Updated
2025-12-07

Features

find_exceptions_in_file

Get details about the 10 most recent exceptions in a specified file, including created_at, exception_type, exception_message, function_name, line_number, attributes, and trace_id. Supports an age parameter to look back over minutes (maximum 7 days).

arbitrary_query

Run an arbitrary SQL query against the Logfire DataFusion database within a lookback window defined by age (in minutes).

logfire_link

Create a direct link to view the specified trace in the Logfire UI using a trace_id.

schema_reference

Return the database schema for the Logfire DataFusion database.

Audience

LLMsEnable language models to query and reason over application telemetry, traces, and Logfire data.
DevelopersIntegrate automated telemetry querying and trace analysis into workflows.

Tags

OpenTelemetrytracesmetricstelemetryLogfireMCPSQLqueriesLLMs