Generated banner for Logs Datadog
Generated logo for Logs Datadog

Logs Datadog

PostHogOfficialCreated by PostHog

  • Skill
  • Tool integration
  • Data and AI
  • MIT
  • No issues found

From the author

PostHog logs for Datadog
— the description by PostHog

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides the configuration steps to forward logs from Datadog-compatible exporters directly to PostHog. By redirecting your log traffic to PostHog's ingestion endpoint, you can centralize system logs alongside your product analytics and session replays, enabling deeper correlation between system behavior and user activity.

What it does

  • Configures Datadog Agents to forward logs to PostHog
  • Provides the specific ingestion endpoint for Datadog-formatted logs
  • Offers guidance on using environment variables for secure token management
  • Supports integration with existing Datadog log exporters
  • Enables verification of log flow into the PostHog interface

When to use it

  • When you want to consolidate system logs into your PostHog project
  • When you are already using Datadog log exporters and want to add PostHog as a destination
  • When you need to correlate backend system logs with frontend user sessions
  • When you want to leverage PostHog's log search and analysis features

Advantages

  • Minimal configuration changes required for existing Datadog setups
  • Centralizes logs alongside product analytics and session replays
  • Maintains compatibility with standard Datadog log formats
  • Uses secure environment variable-based authentication

Usage examples

“How do I point my Datadog agent to PostHog?”
You will be guided to set the DD_LOGS_CONFIG_LOGS_DD_URL environment variable to the PostHog Datadog-compatible endpoint using your project token.
“Where do I find my project token for log ingestion?”
The skill directs you to your PostHog Project Settings to retrieve your project token (starting with phc_).

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/posthog/logs-datadog/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip logs-datadog.zip -d .agents/skills

Documentation by PostHog

PostHog logs for Datadog

This skill helps you add PostHog log ingestion to Datadog applications.

Reference files

  • references/datadog.md - Datadog 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

Consult the documentation for API details and framework-specific patterns.

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.

Framework guidelines

No specific framework guidelines.

Files

references/troubleshooting.md

Logs troubleshooting - Docs

This page covers troubleshooting for Logs. For setup, see the installation guide.

Have a question? Ask PostHog AI

Ask PostHog AI

Authentication errors

Problem: Getting 401 Unauthorized errors when sending logs.

Solutions:

  • Verify you're using the correct project token from Project Settings

  • Check the Authorization header format: Bearer <ph_project_token>

  • If using query parameter, verify the format: ?token=<ph_project_token>

  • Ensure your project token hasn't been rotated or revoked

Connection issues

Problem: Cannot connect to the PostHog logs endpoint.

Solutions:

  • Verify the endpoint URL: https://us.i.posthog.com/i/v1/logs

  • Check that your application can make outbound HTTPS requests

  • Ensure firewall rules allow outbound connections to PostHog

  • For self-hosted instances, verify the endpoint is correct for your deployment

Logs not appearing in PostHog

Problem: Logs are being sent but don't appear in the PostHog interface.

Solutions:

  • Verify your project token is correct and associated with the right project

  • Check that logs are being sent in the correct OTLP format

  • Ensure your project has access to the Logs feature in PostHog

  • Check the network tab in your browser/application to verify requests are succeeding (200 status)

Performance issues

Problem: High memory usage or slow log processing.

Solutions:

  • Adjust the batch size in your OpenTelemetry configuration

  • Use BatchLogRecordProcessor instead of SimpleLogRecordProcessor for better performance

  • Consider filtering logs on the client side to reduce volume

  • Check for network latency between your application and PostHog

Log format problems

Problem: Logs are being received but not parsed correctly.

Solutions:

  • Ensure you're using the standard OTLP log format

  • Verify log levels are set correctly (INFO, WARN, ERROR, etc.)

  • Check that log attributes are properly structured

  • Use the OpenTelemetry logging APIs instead of raw log libraries

Project token authentication issues

Problem: Confused about which key to use or how to authenticate.

Solutions:

  • Use your project token (the same one you use for capturing events)

  • Find it in Project Settings

  • You can authenticate in two ways:

    • Header: Authorization: Bearer <ph_project_token>

    • Query param: ?token=<ph_project_token>

  • Do not use your personal API key or other authentication methods

Self-hosted endpoint issues

Problem: Logs not working with self-hosted PostHog.

Solutions:

  • Use your self-hosted instance URL instead of https://us.i.posthog.com

  • Verify the logs endpoint is enabled on your self-hosted instance

  • Check that the endpoint path is correct: /logs

  • Ensure your PostHog version supports the logs feature

Still having issues?

If you're still experiencing problems:

  1. Verify your OpenTelemetry client configuration matches the examples in the installation guide

  2. Test with a simple log message first before sending complex logs

  3. Check the network requests to see the actual HTTP status codes and error messages

  4. Contact PostHog support with your specific error messages and configuration details

Community questions

Ask a question

Was this page useful?

HelpfulCould be better

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
PostHog
Publisher
PostHog (Official)
Source
PostHog/skills · skills/posthog/logs/skills/datadog · commit a5d30e7
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Also distributed in
PostHog/skills

AutoGineer is not affiliated with or endorsed by PostHog or PostHog.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download logs-datadog.zip