:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
# PostHog metrics agent: scrapes Prometheus /metrics endpoints in your infra
# and forwards them to PostHog as OTLP metrics (exemplars included).
#
# The upstream collector image has no shell, so the collector binary is
# re-based onto alpine to support the config-rendering entrypoint.
# Keep the collector version in sync with tests/integration/docker-compose.yml.
FROM otel/opentelemetry-collector-contrib:0.142.0@sha256:38c349c3b7a2fd7ea46700cde8fa13d35b699ef2ce245bdf34dae2a413512f76 AS collector
FROM alpine:3.21@sha256:48b0309ca019d89d40f670aa1bc06e426dc0931948452e8491e3d65087abc07d
# 20261020-r0 is the first release that distrusts the compromised eMudhra intermediates.
RUN apk add --no-cache 'ca-certificates>=20261020-r0' && adduser -D -u 10001 otel \
&& mkdir -p /var/lib/posthog-agent && chown 10001 /var/lib/posthog-agent
COPY --from=collector /otelcol-contrib /usr/local/bin/otelcol-contrib
COPY config/config.yaml.tmpl /etc/posthog/config.yaml.tmpl
COPY entrypoint.sh /entrypoint.sh
USER 10001
EXPOSE 13133
ENTRYPOINT ["/entrypoint.sh"]