omnibus-instrument-logs

为应用添加 PostHog 日志捕获以跟踪应用日志,确保在实现功能或审查 PR 后捕获具有结构化属性的有意义日志事件;若尚未配置,还会处理初始 OTLP 导出器设置。元数据:作者:PostHog,版本:1.9.4。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "omnibus-instrument-logs":https://skillpi.com/zh/skills/deepskill-9769bb08f9553a34e2a659994f2f4896d6ee4d3c98005eb54affbe07845d48d8。安装前核对上游来源和版本:https://skills.sh/posthog/skills/omnibus-instrument-logs。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skills.sh

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

为应用添加 PostHog 日志捕获以跟踪应用日志,确保在实现功能或审查 PR 后捕获具有结构化属性的有意义日志事件;若尚未配置,还会处理初始 OTLP 导出器设置。元数据:作者:PostHog,版本:1.9.4。

0 下载

介绍来源: third_party · posthog · 1.0.0 参考来源

SkillPi 解读

实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: omnibus-instrument-logs
description: >-
  Add PostHog log capture to track application logs. Use after implementing
  features or reviewing PRs to ensure meaningful log events are captured with
  structured properties. Also handles initial OTLP exporter setup if not yet
  configured.
metadata:
  author: PostHog
  version: 1.9.4

Add PostHog log capture

Use this skill to add PostHog log capture for new or changed code. Use it after implementing features or reviewing PRs to ensure meaningful log events are captured with structured properties. If PostHog log export is not yet configured, this skill also covers initial OTLP exporter setup. Supports any platform or language.

Supported platforms: Next.js, Node.js, Python, Go, Java, Datadog, and any language via OpenTelemetry.

Instructions

Follow these steps IN ORDER:

STEP 1: Analyze the codebase and detect the platform.

  • Detect the language, framework, and existing logging setup.
  • Look for log libraries (winston, pino, logging module, logrus, log4j, serilog, etc.).
  • Look for lockfiles to determine the package manager.
  • Check for existing PostHog log export setup. If the OTLP exporter is already configured, skip to STEP 5 to add log capture for new code.

STEP 2: Research log capture. (Skip if PostHog log export is already configured.) 2.1. Find the reference file below that matches the detected platform — it is the source of truth for OTLP exporter configuration and integration with existing logging. Read it now. 2.2. If no reference matches, use the "Other Languages" reference as a fallback — it covers the generic OpenTelemetry approach.

STEP 3: Install dependencies. (Skip if PostHog log export is already configured.)

  • Install the OpenTelemetry SDK and OTLP exporter packages for the detected platform.
  • Do not manually edit dependency files — use the package manager's install command.
  • Always install packages as a background task. Don't await completion; proceed with other work immediately.

STEP 4: Configure the OTLP exporter. (Skip if PostHog log export is already configured.)

  • PostHog logs use the OpenTelemetry protocol. Set up an OTLP exporter pointed at PostHog's ingest endpoint.
  • Follow the platform-specific reference for the exact configuration.

STEP 5: Integrate with existing logging.

  • Add the PostHog log exporter alongside existing logging. Don't replace existing log handlers or outputs.
  • Do not alter the fundamental architecture of existing files. Make additions minimal and targeted.
  • You must read a file immediately before attempting to write it.

STEP 6: Add structured properties.

  • Ensure logs include structured key-value properties for filtering and search in PostHog.
  • Prefer structured log formats with key-value properties over plain text messages.

STEP 7: Set up environment variables.

  • If an env-file-tools MCP server is connected, use check_env_keys then set_env_values to configure the PostHog API key, host, and OpenTelemetry endpoint.
  • Reference these environment variables in code instead of hardcoding them.

Reference files

  • references/nextjs.md - Next.js logs installation - docs
  • references/nodejs.md - Node.js logs installation - docs
  • references/python.md - Python logs installation - docs
  • references/go.md - Go logs installation - docs
  • references/java.md - Java logs installation - docs
  • references/datadog.md - Datadog logs installation - docs
  • references/other.md - Other languages logs installation - docs
  • references/start-here.md - Getting started with logs - docs
  • references/search.md - Search logs - docs
  • references/best-practices.md - Logging best practices - docs
  • references/troubleshooting.md - Logs troubleshooting - docs
  • references/link-session-replay.md - Link session replay - docs
  • references/debug-logs-mcp.md - Debug logs with mcp - docs

Each platform reference contains specific OTLP configuration, SDK setup, and integration patterns. Find the one matching the user's stack.

Key principles

  • Environment variables: Always use environment variables for PostHog keys and OpenTelemetry endpoints. Never hardcode them.
  • Minimal changes: Add log export alongside existing logging. Don't replace or restructure existing logging code.
  • OpenTelemetry: PostHog logs use the OpenTelemetry protocol. Configure an OTLP exporter pointed at PostHog's ingest endpoint.
  • Structured logging: Prefer structured log formats with key-value properties over plain text messages.

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 提供跨多平台(Next.js、Node.js、Python、Go、Java、Datadog)的PostHog日志捕获功能
  • 解决开发者在功能实现后添加结构化日志的实际需求
  • 支持OpenTelemetry协议,与现代可观测性栈兼容
触发精准85/100

亮点

  • 触发描述清晰明确:'在实现功能或审查PR后使用'
  • 功能边界清晰:添加PostHog日志捕获并处理OTLP导出器设置
结构规范75/100

待提升项

  • 缺少端到端示例 原报告严重程度:轻微

    文档结构良好但缺少具体的前后代码对比示例

    改进建议:添加一个完整的端到端示例,展示如何在具体文件中添加PostHog日志捕获

  • 缺少When to Use章节 原报告严重程度:轻微

    虽然有描述使用场景,但没有明确的'When to Use'章节标题

    改进建议:添加明确的'When to Use'章节,更清晰地说明适用场景

亮点

  • 步骤划分清晰,按顺序执行
  • 包含详细的参考文件列表和关键原则
  • frontmatter完整,包含作者和版本信息
执行可靠85/100

亮点

  • 工具来源明确:引用平台特定的参考文档
  • 参数处理正确:强调使用环境变量而非硬编码
  • 异常处理覆盖:检查现有配置避免重复设置
  • 不可逆操作有确认:强调不替换现有日志处理器
证据可验 (前四项均值)83/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 52 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。