Official agent skill

Logfire Infrastructure

by pydantic in pydantic/skills

Monitor hosts, Docker containers, Kubernetes clusters, database/queue/cache servers, and cloud-provider metrics with Pydantic Logfire — no application code required.

OfficialMITAuto-check passedDevOps & Cloud

Install Logfire Infrastructure

skills CLI
$ npx skills add pydantic/skills --skill logfire-infrastructure -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pydantic/skills logfire-infrastructure --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pydantic/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/logfire-infrastructure .claude/skills/logfire-infrastructure && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
logfire-infrastructure
GitHub stars
140
Token cost
~1.8k tokens
SKILL.md length
863 words
Files
2 (incl. references)
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Monitor hosts, Docker containers, Kubernetes clusters, database/queue/cache servers, and cloud-provider metrics with Pydantic Logfire — no application code required.

  • Works in 4 steps: Authenticate and Select the Exact Project → Identify What to Monitor → Configure the Collector → …
  • The user asks to monitor my host/server/VM
  • SKILL.md covers How This Works, Step 1: Authenticate and…, Step 2: Identify What to Monitor and Step 3: Configure the Collector, plus 2 more sections
  • Calls kubectl and docker

What it does

Logfire Infrastructure is an agent skill from pydantic/skills, published by the product's own GitHub organization. Monitor hosts, Docker containers, Kubernetes clusters, database/queue/cache servers, and cloud-provider metrics with Pydantic Logfire — no application code required. Use this skill whenever the user asks to "monitor my host/server/VM", "monitor my Docker containers", "monitor my Kubernetes cluster", "send infrastructure metrics to Logfire", "watch my database/Postgres/Redis/MongoDB/Kafka", "collect cloud metrics" (AWS/GCP), or mentions the OpenTelemetry Collector in the context of Logfire. This is infrastructure…

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/collector/host-and-infra-metrics.md`).

It sits in DevOps & Cloud, covering Containers, Observability and Container orchestration. It works with Pydantic, Docker, Kubernetes and OpenTelemetry. The licence is MIT.

When your agent uses it

  • The user asks to monitor my host/server/VM
  • Monitor my Docker containers
  • Monitor my Kubernetes cluster
  • Send infrastructure metrics to Logfire

Example prompts

  • “monitor my host/server/VM”
  • “monitor my Docker containers”
  • “monitor my Kubernetes cluster”
  • “/logfire-infrastructure”

Requirements

  • Docker

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Authenticate and Select the Exact Project
  2. Identify What to Monitor
  3. Configure the Collector
  4. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 238d971. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • kubectl
    • docker

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • pydantic.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Logfire Infrastructure loads about 1.8k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 165 tokens; SKILL.md has 863 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~165
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pydantic/skills at commit 238d971, republished under its MIT licence (© pydantic). 863 words, ~1,798 tokens.

Download SKILL.mdSave it as .claude/skills/logfire-infrastructure/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
logfire-infrastructure
description
Monitor hosts, Docker containers, Kubernetes clusters, database/queue/cache servers, and cloud-provider metrics with Pydantic Logfire — no application code required. Use this skill whenever the user asks to "monitor my host/server/VM", "monitor my Docker containers", "monitor my Kubernetes cluster", "send infrastructure metrics to Logfire", "watch my database/Postgres/Redis/MongoDB/Kafka", "collect cloud metrics" (AWS/GCP), or mentions the OpenTelemetry Collector in the context of Logfire. This is infrastructure only — for instrumenting APPLICATION CODE (traces, logs, AI/agent spans) use the logfire-instrumentation skill instead.

Monitor Infrastructure with Logfire

Do not use this skill for application-level traces, logs, or AI/agent spans — that's logfire-instrumentation. The two compose: a full setup often runs both.

How This Works

The OpenTelemetry Collector ships host, container, cluster, and infrastructure-service metrics to Logfire with no application code changes — Logfire is a fully compliant OTel backend and ingests standard OTLP traces, logs, and metrics from it (one narrow exception noted in the collector reference), so the Collector is the entire mechanism. This is optional and is an advanced tool: if the user only wants their app's own traces, logfire-instrumentation's language SDKs are enough on their own.

Step 1: Authenticate and Select the Exact Project

Do not open, read, or run any infrastructure config file (docker-compose.yml, a Kubernetes manifest, or similar) until whoami confirms you're authenticated to the right project — nothing about this step requires knowing what's being monitored. Auth is also the one step that can block on a human (browser sign-in), so starting it first means that wait begins on turn one, not after Step 2's detection work.

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, including its safe handoff for the write credential created by projects use.

Step 2: Identify What to Monitor

Detect the infrastructure actually in play, don't assume:

  • Host/VM: monitoring the machine itself (CPU, memory, disk, network, load).
  • Docker: read docker-compose.yml / Dockerfiles for running containers.
  • Kubernetes: look for manifests, a kubeconfig, or kubectl context.
  • Database/queue/cache servers: read docker-compose.yml / pyproject.toml / package.json for Postgres, MySQL, Redis, MongoDB, Kafka, RabbitMQ, Nginx, Apache, Elasticsearch, or Memcached.
  • Cloud provider: GCP or AWS metrics (Cloud Monitoring, CloudWatch, ECS), when the user names the provider or the app clearly runs there.

More than one can apply at once — a single Collector can run multiple receivers in parallel pipelines.

Step 3: Configure the Collector

Follow the collector reference for the receiver(s) identified in Step 2 — it covers the shared exporter setup, then a dedicated section per source: host metrics, Docker, Kubernetes, database/queue/cache servers, and cloud-provider metrics, each with the exact receiver name, a working config, and the caveats that actually bite (Docker socket permissions, API version pinning, host.docker.internal vs localhost, IAM permissions, ADOT vs. Contrib collector images).

Set the same service & resource metadata conventions the collector reference describes — host.name, service.name, service.instance.id — so data groups correctly across the Hosts, Kubernetes, and Metrics pages.

Before starting or restarting the Collector, validate the config file — a receiver typo or bad indentation should surface as a validation error, not a Collector that starts, logs nothing useful, and silently drops the pipeline:

bash
otelcol-contrib validate --config=collector-config.yaml
# or, for the core (non-Contrib) distribution: otelcol validate --config=...

If neither binary is on PATH, inspect the running Collector container (for example with kubectl exec) or use the deployment-specific validation command from the image entrypoint, systemd unit, or Helm chart. docker compose config or kubectl get pod <name> -o yaml can show the command when it is explicitly configured.

Show full SKILL.md (324 more words)Show less

Step 4: Verify

Wiring a receiver isn't done when the Collector starts cleanly — confirm the data actually reached the right page for the right host/container/cluster, not just that something arrived. Never report a metric as "arrived" without having queried for it in this same session — a plausible-sounding summary that wasn't checked is worse than saying you couldn't verify.

  1. Restart the Collector after any config change (having validated it, above).
  2. Query for the exact resource you configured, not just any data on the page. If a Logfire MCP server or API is connected in this session, query for the specific host.name / container / cluster you set in Step 3 within the last few minutes — a query that returns zero rows for that exact identifier means it didn't land, even if the page shows data from something else. Otherwise, open the specific product page — Hosts, Docker, or Kubernetes — or the Metrics explorer for database/queue/cache/cloud sources, and look for that same exact identifier.
  3. If nothing appears, check in order: the exporter endpoint/region and write token, that the receiver is in an active pipeline (not defined but never referenced under service.pipelines), and that resource attributes (host.name, service.name) are set — the reference's own Verify section has the full troubleshooting path.
  4. Fix and re-check until the specific source is visible, not just "some" data.

Close with a final report built from what you just confirmed — org/project/region from whoami, which receiver(s) are active, and the exact host/container/cluster identifier you verified — not a template. Include a direct link to the relevant view (/hosts, /docker, /kubernetes, or /metrics, based on the source) using the project's URL from whoami, so the user can see their own source arrive without having to ask where to look. A report with a placeholder in it means a step above was skipped, not finished.

References

© pydantic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/logfire-infrastructure of pydantic/skills.

  • SKILL.md
  • references/collector/host-and-infra-metrics.md

Open the folder on GitHubat commit 238d971

Compare with similar skills

Logfire Infrastructure next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Logfire Infrastructure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Logfire Infrastructure this skillpydantic/skills140—~1.8kAutomated safety check: PassMIT
Agent Bom Scan InfraLeoYeAI/openclaw-master-skills2.2k—~1.5kAutomated safety check: PassApache-2.0
Discover Infrarand/cc-polymath181—~783Automated safety check: PassMIT
Cloud AuditCommonHuman-Lab/nyxstrike156—~1.1kAutomated safety check: PassCustom licence
Ak Cloud Deployyaalalabs/agent-kernel191—~14kAutomated safety check: PassApache-2.0
Senior DevOps Toolkitmaslennikov-ig/claude-code-orchestrator-kit2596 repos~1.1kAutomated safety check: NotesCustom licence

Similar skills

  • Agent Bom Scan Infra

    LeoYeAI/openclaw-master-skills

    Scan infrastructure-as-code, cloud configurations, and find secrets.

    2.2k GitHub stars~1.5k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed
  • Discover Infra

    rand/cc-polymath

    Automatically discover cloud, infrastructure, deployment, and container skills when working with AWS, GCP, Azure, Docker, Kubernetes, Terraform, Netlify, Heroku, serverless, or IaC

    181 GitHub stars~783 tokensUpdated 7 mo ago
    DevOps & CloudAuto-check passed
  • Cloud Audit

    CommonHuman-Lab/nyxstrike

    Cloud and container security auditing workflow using prowler, trivy, kube-hunter, and docker-bench for AWS, GCP, Azure, Kubernetes, and container images

    156 GitHub stars~1.1k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Ak Cloud Deploy

    yaalalabs/agent-kernel

    Deploy an Agent Kernel project to AWS, Azure, or GCP using Terraform modules, or to any Kubernetes cluster (on-prem, baremetal, EKS) using the official Helm chart.

    191 GitHub stars~14k tokensUpdated today
    Backend & APIsAuto-check passed
  • Senior DevOps Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup…

    259 GitHub starsUsed in 6 repos~1.1k tokens
    DevOps & CloudAuto-check: notes
  • Devops

    nicepkg/auto-company

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm).

    192 GitHub starsUsed in 2 repos~814 tokens
    DevOps & CloudAuto-check passed

More from pydantic/skills

All 9 skills in this repo
  • Logfire Query

    pydantic/skills

    Official

    Query and analyze Logfire telemetry data — traces, logs, spans, metrics, summaries, and SQL results.

    140 GitHub stars~2.2k tokensUpdated 6 days ago
    Auto-check passed
  • Pydantic AI Harness

    pydantic/skills

    Official

    Extend Pydantic AI agents with batteries-included capabilities from pydantic-ai-harness -- Code Mode (collapse many tool calls into one sandboxed Python execution), a filesystem and shell…

    140 GitHub stars~1.9k tokensUpdated 6 days ago
    Auto-check passed
  • Official

    Build AI agents with Pydantic AI — tools, capabilities (including on-demand loading), structured output, streaming, testing, and multi-agent patterns.

    140 GitHub stars~5.4k tokensUpdated 6 days ago
    Auto-check passed
  • Logfire Evals

    pydantic/skills

    Official

    Run offline Python (pydanticevals) or Node.js (logfire/evals) evaluations and review them in Logfire.

    140 GitHub stars~3.6k tokensUpdated 6 days ago
    Auto-check passed
  • Official

    Add Pydantic Logfire observability to application code — traces, logs, metrics, and AI/agent spans.

    140 GitHub stars~6.1k tokensUpdated 6 days ago
    Auto-check passed
  • Logfire UI

    pydantic/skills

    Official

    Open or return Logfire project pages, live views, trace links, and Explore pages in the Codex browser without querying telemetry first.

    140 GitHub stars~2.9k tokensUpdated 6 days ago
    Auto-check passed

Categories

Questions about Logfire Infrastructure

What does Logfire Infrastructure do?

Monitor hosts, Docker containers, Kubernetes clusters, database/queue/cache servers, and cloud-provider metrics with Pydantic Logfire — no application code required. Logfire Infrastructure is an agent skill from pydantic/skills, published by the product's own GitHub organization. Monitor hosts, Docker containers, Kubernetes clusters, database/queue/cache servers, and cloud-provider metrics with Pydantic Logfire — no application code required.

When should I use Logfire Infrastructure?

Logfire Infrastructure fits situations like: the user asks to monitor my host/server/VM; monitor my Docker containers; monitor my Kubernetes cluster; send infrastructure metrics to Logfire.

How do I install Logfire Infrastructure in Claude Code?

Run `npx skills add pydantic/skills --skill logfire-infrastructure -a claude-code`. Or copy the skill folder (skills/logfire-infrastructure in pydantic/skills) into .claude/skills/logfire-infrastructure in your project. Claude Code loads it when a task matches its description.

How do I install Logfire Infrastructure in Codex?

Run `npx skills add pydantic/skills --skill logfire-infrastructure -a codex`. Or copy the skill folder (skills/logfire-infrastructure in pydantic/skills) into .agents/skills/logfire-infrastructure in your project. Codex loads it when a task matches its description.

Can I use Logfire Infrastructure in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pydantic/skills --skill logfire-infrastructure -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/logfire-infrastructure, .gemini/skills/logfire-infrastructure, .github/skills/logfire-infrastructure and .opencode/skills/logfire-infrastructure in your project.

What does Logfire Infrastructure need to run?

Going by SKILL.md and its folder, Logfire Infrastructure needs the command-line tools its instructions call (kubectl and docker). Our summary lists: Docker.

Does Logfire Infrastructure access the network?

SKILL.md names 1 domain. As links in the text: pydantic.dev. This is read from the text; nothing was executed.

Is Logfire Infrastructure safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Logfire Infrastructure use?

Logfire Infrastructure is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Logfire Infrastructure use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.4k tokens, read only when the agent opens those files.

What are the alternatives to Logfire Infrastructure?

Skills that share tags, products or a category with Logfire Infrastructure: Agent Bom Scan Infra (LeoYeAI/openclaw-master-skills, 2.2k stars), Discover Infra (rand/cc-polymath, 181 stars), Cloud Audit (CommonHuman-Lab/nyxstrike, 156 stars) and Ak Cloud Deploy (yaalalabs/agent-kernel, 191 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Logfire Infrastructure?

pydantic (a GitHub organization, an official publisher) maintains it in pydantic/skills, which has 140 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 1, 2026.

Source: pydantic/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.