Logfire Setup

作者 pydantic238d97102650无许可证收录于 2026年10月8日更新于 2026年10月8日

Entry point for Pydantic Logfire — an observability, monitoring, and evals platform. Use this skill when the user asks to "set up Logfire", "add Logfire to my project", "get me set up properly with Logfire", "send as much data as would be useful", mentions Logfire without a specific scope, or their request spans more than one of instrumenting application code / monitoring infrastructure / evaluating AI behavior. If the request is clearly scoped to exactly one of those, fetch that specific skill directly instead of this one — this skill exists to route, not to duplicate their content.

AI 生成的概览

在完成身份验证并确定目标项目后,将 Logfire 设置请求路由到合适的子技能。

功能
这是 Pydantic Logfire(一个可观测性、监控与评估平台)的路由入口。它会完成身份验证、确认具体的 Logfire 项目与区域、检查代码仓库以判断适用的产品面,然后指向对应的子技能来完成安装、埋点与验证。它本身不包含安装或埋点的具体细节。
适用场景
当设置 Logfire 的请求范围不明确,或同时涉及多个产品面(如应用埋点、基础设施监控或 AI 评估)时使用。如果请求明确只涉及单一产品面,应直接获取对应的具体技能。
运行要求
需要已通过身份验证的 Logfire 账户和 CLI 访问权限,以及用于获取所引用子技能的网络访问。它不附带脚本,仅为说明文档。

Set Up Logfire

Logfire is an observability platform built on OpenTelemetry, with several distinct product surfaces. This skill authenticates, orients, and routes you to the specific skill for the surface you actually need — don't try to cover install/instrument/verify detail from within this file.

Keep the user informed with short updates, but proceed through ordinary, reversible setup without asking approval — no clean tree, branch, commits, or plan needed, and no commands the user could run only because you chose not to. Pause only for: browser auth, a genuinely ambiguous app/project after inspection, materially increasing production telemetry or cost, deploy/infra changes, or destructive/unrelated work — then ask one concrete question. Never report a check, a score, or a run as verified without having actually confirmed it in this session.

Step 1: Authenticate and Select the Exact Project

Auth comes first because everything after it depends on having a valid, confirmed connection to the exact right Logfire project: instrumenting or inspecting the repo before that is either wasted if the connection turns out wrong, or worse, ends up silently wired to the wrong project. Do not open, read, or run any project file until whoami confirms you're authenticated to the right project — nothing about this step requires knowing what's in the repo yet.

Use Authenticate and Select the Exact Project to derive the CLI target from the supplied Logfire URL and run its target-aware whoami check with a verified CLI path — for JS/TS projects without uv, use the external-prefix npm fallback instead of plain npx, which can execute a repository-local binary. Skip to Step 2 if that already reports the right project and resolved --region or --base-url target; otherwise, continue through the full authentication and project-selection sequence there.

Step 2: Understand the Repo

Read AGENTS.md/CLAUDE.md/README.md and skim the language, runtime, and package manager. Then match what you find against the table below to decide what to fetch next:

SurfaceCoversSkill
App instrumentationTraces, logs, metrics, and AI/agent spans from application code — Python, JavaScript/TypeScript, Rust, or any OpenTelemetry languagelogfire-instrumentation
Infrastructure monitoringHosts, Docker, Kubernetes, database/queue/cache servers, cloud-provider metrics — no application codelogfire-infrastructure
EvalsSet up and run AI/agent evaluations against test-case datasets in Python or Node.jslogfire-evals
Querying telemetrySearch traces/logs/spans/metrics, summarize errors, find root causelogfire-query
Live UIOpen project pages, the live view, trace links, or the Explore page in a browserlogfire-ui
Feature flagsRuntime-managed variables (logfire.var(), logfire.template_var())no dedicated skill yet — see the product's own docs
AI GatewaySpend caps, failover, and routing for model calls (logfire gateway)no dedicated skill yet — see the product's own docs
  • No specific scope given (e.g. "set up Logfire in this repo end to end")? Default to logfire-instrumentation for ordinary application code. Incidental Docker, Kubernetes, infrastructure, or eval files do not expand the initial setup: get one representative application service to verified first data, then offer the matching additional skill(s). If the repository is clearly infrastructure-only, route directly to logfire-infrastructure instead.
  • A request already scoped to one surface ("monitor my Postgres server", "set up evals for this agent") → fetch that skill directly, skipping the rest of this table.
  • Genuinely ambiguous between two adjacent surfaces (e.g. "watch my Postgres" could mean Collector-level infrastructure metrics or app-level query instrumentation)? Ask one clarifying question rather than guessing — loading the wrong skill wastes the user's time reading instructions for a job they didn't ask for.

Step 3: Fetch the Right Skill(s)

Fetch the skill(s) identified in Step 2 now, for the actual install/instrument/verify steps. Each one's own authenticate step still runs its own whoami check first — that's what confirms it's the same project and region resolved here, not an assumption carried over — and only then skips the rest of its auth commands. They're independently fetchable on purpose, so this composes whether someone reaches a specific skill through this hub or on its own.

Never print, log, hard-code, commit, or echo a token, in any of these skills, at any point. The one exception — reading .logfire/logfire_credentials.json's token key programmatically to hand a non-native-SDK application its write token, never to display it — is in auth.md.

来源与署名

来源:pydantic/skills位于plugins/logfire/skills/logfire-setup提交238d971

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架