Monitoring your Formbricks installation for optimal performance.
Formbricks follows Next.js best practices with all logs being written to stdout/stderr, making it easy to collect and forward logs to your preferred logging solution.
debug
: Detailed information for debugging purposes.info
: General information about the system’s operation.warn
: Potential issues that may require attention.error
: Errors that occur during the operation of the system.fatal
: Critical errors that cause the system to crash.Formbricks uses JSON format for logs, which is structured and easy to parse. Each log entry includes:
level
: The log level (e.g., info, error).time
: Timestamp of the log entry in milliseconds since epoch.pid
: Process ID of the application.hostname
: Hostname of the server where the log was generated.requestId
: Unique identifier for the request (if applicable).userId
: Unique identifier for the user (if applicable).msg
: The log message.stack
: Stack trace (if applicable).data
: Additional data related to the log entry.You can configure the minimum log level using the LOG_LEVEL
environment variable. Valid values: debug
, info
, warn
, error
, fatal
.
The default log level in production environments is warn
, while in development environments it is debug
.
Since all logs are written to stdout/stderr, you can integrate with various logging solutions:
Formbricks offers two complementary observability approaches:
Formbricks leverages Next.js’s built-in OpenTelemetry instrumentation for tracing and APM integration. When enabled, it automatically instruments various aspects of your application, providing detailed insights into request flows and performance.
To enable Next.js OpenTelemetry, set the following environment variables:
The Next.js OpenTelemetry integration automatically tracks:
OpenTelemetry trace data can be exported to various observability platforms:
Formbricks implements a dedicated Prometheus metrics exporter using OpenTelemetry. This integration runs a metrics server on a separate port and exposes metrics in Prometheus format for scraping. It focuses specifically on host and runtime metrics rather than application-specific traces.
To enable and configure the Prometheus exporter, set the following environment variables:
The PROMETHEUS_ENABLED
environment variable must be set to 1
to enable metrics collection. The PROMETHEUS_EXPORTER_PORT
variable is optional and defaults to 9464 if not specified.
The exporter listens on all network interfaces (0.0.0.0) and exposes metrics at the /metrics
endpoint.
The metrics exported by the Prometheus integration include:
Host Metrics:
HTTP Metrics:
Runtime Metrics:
You can scrape metrics from your Prometheus server by adding the following to your Prometheus configuration:
The metrics include resource attributes automatically detected from:
These attributes can help you filter and group metrics in your dashboards.
Available endpoints:
Use these endpoints for monitoring system health in container orchestration and monitoring tools.