Comprehensive monitoring and observability for self-hosted Formbricks deployments using industry-standard tools.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/formbricks/formbricks/llms.txt
Use this file to discover all available pages before exploring further.
Observability Stack Overview
Formbricks supports multiple observability approaches: Supported Backends:- Metrics: Prometheus, OpenTelemetry (OTLP)
- Traces: Jaeger, Tempo, SigNoz, Honeycomb
- Logs: Pino with optional OpenTelemetry transport
OpenTelemetry Integration
Formbricks includes comprehensive OpenTelemetry instrumentation for metrics and distributed tracing.Configuration
Enable OpenTelemetry by setting environment variables:.env
Sampler Types
Control which traces are collected:| Sampler | Description | Use Case |
|---|---|---|
always_on | Trace every request | Development, debugging |
always_off | Disable tracing | Production (metrics only) |
traceidratio | Sample by percentage | Production (reduce overhead) |
parentbased_traceidratio | Respect parent span decisions | Distributed systems |
parentbased_always_on | Trace if parent traced | Microservices |
Instrumented Components
Formbricks automatically instruments:HTTP Requests
- Incoming HTTP requests
- Outgoing HTTP calls
- Request/response headers
- Status codes and errors
Database Queries
- Prisma ORM queries
- Query duration
- Connection pool metrics
- Query parameters (sanitized)
Node.js Runtime
- Event loop lag
- Memory usage (heap)
- Garbage collection
- Active handles/requests
External Services
- SMTP connections
- S3 storage operations
- Redis cache operations
- License API calls
Implementation Reference
OpenTelemetry configuration:apps/web/instrumentation-node.ts:1
Key features:
- Auto-instrumentation for Node.js libraries
- Prisma database tracing
- Configurable sampling strategies
- Support for both OTLP metrics and traces
- Graceful shutdown handling
Prometheus Metrics
Enable Prometheus Exporter
Expose metrics on/metrics endpoint:
http://localhost:9464/metrics
Kubernetes ServiceMonitor
For Kubernetes with Prometheus Operator:values.yaml
Available Metrics
Formbricks exposes metrics via OpenTelemetry SDK: HTTP Metrics:Grafana Dashboard
Example Prometheus queries for Grafana:Structured Logging
Log Configuration
Formbricks uses Pino for structured JSON logging:debug: Verbose debugging information (development only)info: General informational messageswarn: Warning messages, non-critical issueserror: Error events that might still allow continued operationfatal: Critical errors causing application shutdown
Log Output Format
Production logs are structured JSON:OpenTelemetry Log Correlation
Enable log-trace correlation with SigNoz or similar:packages/logger/src/logger.ts:45
Features:
- Automatic trace ID injection
- Span context in logs
- Log shipping to OpenTelemetry collector
- Correlated traces and logs in SigNoz
Log Aggregation
For centralized logging:- Loki (Grafana)
- Elasticsearch
- CloudWatch (AWS)
Docker:Kubernetes:
docker-compose.yml
Distributed Tracing
Jaeger Setup
Deploy Jaeger for trace visualization:- Docker Compose
- Kubernetes
docker-compose.yml
http://localhost:16686SigNoz (Full Stack Observability)
SigNoz provides metrics, traces, and logs in one platform:http://localhost:3301
Features:
- Unified metrics, traces, and logs
- Automatic service topology mapping
- Query builder for custom dashboards
- Alerts and notifications
Application Health Checks
Health Endpoints
Formbricks exposes health check endpoints:Kubernetes Probes
Configured in Helm values:values.yaml
- Startup: Delays other probes until app is initialized
- Readiness: Removes pod from service endpoints if failing
- Liveness: Restarts container if failing
Usage Analytics & Telemetry
Formbricks Internal Telemetry
Formbricks sends anonymous usage statistics for license validation and product improvement: Data Collected:- Instance ID (hashed organization ID)
- Usage counts (organizations, users, surveys, responses)
- Feature enablement (SSO, S3, integrations)
- Version information
- Infrastructure details (SMTP configured, S3 configured, etc.)
apps/web/app/api/(internal)/pipeline/lib/telemetry.ts:21
How It Works:
- Runs automatically every 24 hours via pipeline API
- Uses distributed locking via Redis to prevent duplicate sends
- Sends to
https://ee.formbricks.com/api/v1/instances/{instanceId}/usage-updates - Non-blocking, non-essential operation
- No personally identifiable information (PII) is sent
- No survey content or responses
- Instance ID is a one-way hash
- Respects enterprise license terms
Telemetry cannot be disabled as it’s required for enterprise license validation.
Alerting
Prometheus Alertmanager
Example alert rules:prometheus-rules.yml
Notification Channels
Configure Alertmanager receivers:- Slack
- PagerDuty
- Email
alertmanager.yml
Error Tracking with Sentry
Formbricks supports Sentry for error tracking:- Unhandled exceptions
- Promise rejections
- React error boundaries
- API errors
- Database errors
apps/web/sentry.server.config.ts:1
Sentry telemetry is disabled by default in Formbricks configuration to reduce noise.
Monitoring Dashboard Examples
Grafana Dashboard JSON
Key panels to include:-
Request Rate:
-
Error Rate:
-
Response Time Percentiles:
-
Database Query Duration:
-
Pod Resource Usage:
Best Practices
Metrics Collection
- Start with Prometheus for simplicity
- Use OpenTelemetry for advanced tracing needs
- Sample traces in production (5-10%) to reduce overhead
- Retain metrics for at least 30 days
- Monitor both application and infrastructure metrics
Log Management
- Use structured JSON logging in production
- Set appropriate log levels (info or warn in production)
- Centralize logs for multi-instance deployments
- Implement log rotation and retention policies
- Correlate logs with traces via trace IDs
Alerting Strategy
- Alert on symptoms, not causes (e.g., “high latency” not “high CPU”)
- Set appropriate thresholds to avoid alert fatigue
- Include runbook links in alert annotations
- Test alerts in staging before production
- Review and tune alerts regularly
Performance Monitoring
- Track key metrics: request rate, error rate, latency (RED method)
- Monitor database query performance
- Set up synthetic monitoring for critical user flows
- Establish SLIs/SLOs for important services
- Perform regular load testing
Troubleshooting
Metrics Not Appearing in Prometheus
Metrics Not Appearing in Prometheus
Checklist:
- Verify
PROMETHEUS_ENABLED=1is set - Check
/metricsendpoint is accessible: - Verify ServiceMonitor labels match Prometheus selector
- Check Prometheus scrape targets:
- Review Prometheus logs for scrape errors
Traces Not Visible in Jaeger
Traces Not Visible in Jaeger
Solutions:
- Verify OTLP endpoint is correct and reachable
- Check sampling configuration (ensure not
always_off) - Verify Jaeger collector is running and accepting OTLP
- Review Formbricks logs for OTLP export errors
- Test with
OTEL_TRACES_SAMPLER=always_ontemporarily
High Cardinality Metrics
High Cardinality Metrics
Issue: Too many unique label combinations causing performance issuesSolutions:
- Avoid labels with unbounded values (user IDs, timestamps)
- Use trace sampling instead of labeling every request
- Aggregate before exporting if possible
- Review Prometheus queries for high cardinality
Further Resources
- OpenTelemetry Documentation
- Prometheus Best Practices
- Grafana Dashboards
- SigNoz Documentation
- Jaeger Documentation
For help configuring monitoring for large-scale deployments, contact Formbricks support.