instrument-logs

Configure an OTLP exporter to send structured logs to PostHog.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill instrument-logs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instrument-logs
Source: https://github.com/PostHog/skills/tree/main/skills/omnibus/instrument-logs
Command: npx skills add https://github.com/PostHog/skills --skill instrument-logs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill enables PostHog log capture across platforms by integrating OpenTelemetry OTLP exporter and wiring it into existing logging to ensure structured logs are exported to PostHog.

Core Features & Use Cases

  • Cross-language log capture and exporter configuration to PostHog
  • Seamless integration with existing logging without replacing cores
  • Guidance for initial exporter setup and environment variable configuration in diverse projects

Quick Start

Configure your project to send logs to PostHog via OTLP, then start emitting structured logs for observability.

Frequently Asked Questions about instrument-logs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure an OTLP exporter to send logs to PostHog?

Configure an OTLP exporter to send logs to PostHog by setting the HTTP endpoint to https://us.i.posthog.com/i/v1/logs (or EU equivalent) and using environment variables for credentials. This wires OpenTelemetry-compatible clients to emit structured logs.

Does PostHog log capture work with Python and Next.js environments?

PostHog log capture works across Python, Next.js, Node.js, Go, Java, and Datadog environments. It integrates with existing logging cores using an OpenTelemetry-compatible client without replacing your current setup.

Can I integrate PostHog log capture without replacing my existing logging framework?

You can integrate PostHog log capture without replacing existing logging frameworks by wiring the OTLP exporter into your current setup. This enables structured log export to PostHog seamlessly across diverse runtimes.

What is the best way to avoid hardcoding credentials when setting up OpenTelemetry log export?

The best way to avoid hardcoding credentials during OpenTelemetry log export is through environment-based configuration. This approach secures your PostHog endpoint setup while maintaining cross-language compatibility.

Why do I need an OpenTelemetry-compatible client for PostHog log capture?

An OpenTelemetry-compatible client is required for PostHog log capture because it provides the standard protocol for transmitting structured logs via the OTLP HTTP endpoint, ensuring cross-language observability.

Are there limitations when using OTLP HTTP export for log capture in Datadog environments?

When using OTLP HTTP export for log capture in Datadog environments, ensure your OpenTelemetry client supports the endpoint format and that environment variables are correctly configured to avoid credential hardcoding limitations.