omnibus-instrument-logs

Add PostHog log capture to track application logs, ensuring meaningful, structured log events are captured after feature implementation or PR review; if not yet configured, handle initial OTLP exporter setup. Metadata: Author: PostHog, Version: 1.9.4.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "omnibus-instrument-logs" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9769bb08f9553a34e2a659994f2f4896d6ee4d3c98005eb54affbe07845d48d8. Verify the upstream source and version against https://skills.sh/posthog/skills/omnibus-instrument-logs before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skills.sh

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Add PostHog log capture to track application logs, ensuring meaningful, structured log events are captured after feature implementation or PR review; if not yet configured, handle initial OTLP exporter setup. Metadata: Author: PostHog, Version: 1.9.4.

0 Downloads

Introduction source: third_party · posthog · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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.

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

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

Highlights

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

Areas to improve

  • 缺少端到端示例 Reported severity: Minor

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

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

  • 缺少When to Use章节 Reported severity: Minor

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

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

Highlights

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

Highlights

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

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

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

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 52

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.