﻿---
title: "通过 Logfire 导出会话遥测"
filename: "terminal"
canonical: /templates/logfire-exporter-codex-plugin/
---

# 通过 Logfire 导出会话遥测

安装 logfire-exporter@pydantic-skills，通过 Stop 钩子导出遥测。LOGFIRE_TOKEN 写入 config.env，正文采集模式默认 full。

```
codex plugin marketplace add pydantic/skills --ref main
codex plugin add logfire-exporter@pydantic-skills
codex plugin list

# ~/.config/logfire-exporter/config.env
# LOGFIRE_TOKEN=pylf_...
# LOGFIRE_BASE_URL=https://logfire-us.pydantic.dev
# CODEX_LOGFIRE_CONTENT_CAPTURE_MODE=metadata_only

# ~/.codex/config.toml
# [features]
# hooks = true
# [plugins."logfire-exporter@pydantic-skills"]
# enabled = true

# 查遥测才另装：
# codex plugin add logfire@pydantic-skills

# 欧盟 MCP：
# codex mcp remove logfire
# codex mcp add logfire --url https://logfire-eu.pydantic.dev/mcp
# codex mcp login logfire

# 升级：
# codex plugin marketplace upgrade pydantic-skills
# codex plugin add logfire-exporter@pydantic-skills

# 不要：
# claude plugin install logfire@claude-plugins-official
# npx skills add pydantic/skills
# mcp login   # 对导出器
# logfire-exporter@openai-curated

```
