Default mode
Default mode is the default Prisme Analytics mode that aims to provide a fully integrated and functional experience.
It integrates with ClickHouse and Grafana to setup a functional environment. Databases tables, Grafana datasources and dashboards are all prepared during server start up.
Overview
Configuration options
Configuration of your instance is done by environment variable.
Web server
Prisme has 2 logs, an access logs for processed requests and a general logs for everything else.
All logs are structured JSON that follows
bunyan
format.
You can pipe logs to bunyan
CLI to pretty print them.
Access Log
Path to access log file.
Default: PRISME_ACCESS_LOG=/dev/stdout
Port
Web server listening TCP port.
Default: PRISME_PORT=80
API Endpoints Timeout
Duration before handlers timeout on /api/*
endpoints.
Default: PRISME_API_EVENTS_TIMEOUT=3s
Administration Server
Since v0.15.0, Prisme is able to collect and expose it's metrics on the newly added administration interface.
Host Port
<host>:<port>
string on which administration server will listen.
Default: PRISME_ADMIN_HOSTPORT=127.0.0.1:9090
(PRISME_ADMIN_HOSTPORT="0.0.0.0:9090"
in Docker)
Proxy options
Prisme Analytics can be positioned behind a reverse proxy, and this section provides information on options related to the proxy setup. It's important to note that a misconfigured server can have security implications. Hence, Prisme Analytics prioritizes security by default with carefully chosen default values.
Trust proxy
Whether X-Forwarded-For, X-Request-Id and other proxy related headers should be trusted. Sets this value to true only if your instance is running behind a proxy.
Default: PRISME_TRUST_PROXY=false
Proxy header
HTTP header used to determine client IP address when Prisme Analytics is placed behind a trusted proxy.
Default: PRISME_PROXY_HEADER=X-Forwarded-For
Proxy request id header
HTTP header used to retrieve request ID forwarded by a trusted proxy. If header is empty, a new request id will be generated.
Default: PRISME_PROXY_REQUEST_ID_HEADER=X-Request-Id
Grafana options
URL
URL pointing to an healthy Grafana instance.
Example: PRISME_GRAFANA_URL=http://grafana.localhost:3000
This option is mandatory.
User
Username of Grafana user used to setups Grafana datasource, folder and dashboards.
Example: PRISME_GRAFANA_USER=prismebot
This option is mandatory.
Password
Password of Grafana user used to setups Grafana datasource, folder and dashboards.
Example: PRISME_GRAFANA_PASSWORD=securepassword
This option is mandatory.
Organization ID
ID of Grafana organization in which Grafana resources will be setup.
Default: PRISME_GRAFANA_ORG_ID=1
ClickHouse options
Secure connection
Use a TLS connection for ClickHouse.
Default: PRISME_CLICKHOUSE_TLS=false
Host and port
<host>:<port>
string pointing to a ClickHouse instance.
Example: PRISME_CLICKHOUSE_HOSTPORT=clickhouse.localhost:9000
This option is mandatory.
Database
ClickHouse database to use.
Default: PRISME_CLICKHOUSE_DATABASE=prisme
Origin registry options
Origins
Comma separated list (without whitespace) of valid origins. Events coming from an invalid source are rejected.
Example: PRISME_ORIGIN_REGISTRY_ORIGINS=www.example.com,app.example.com
Event store options
Event store is responsible of storing events efficiently in ClickHouse.
ClickHouse recommend keeping number of insertions to 1 per seconds max and inserting rows per batch of tens of thousands.
Maximum batch size
Maximum size of an events batch before it is sent to ClickHouse. Leave as default unless you have high traffic load.
Default: PRISME_EVENTSTORE_MAX_BATCH_SIZE=4096
Maximum batch timeout
Maximum duration before current batch is sent to event store.
Default: PRISME_EVENTSTORE_MAX_BATCH_TIMEOUT=1m
Session storage
In-memory session storage options. Sessions are linked to a device id which is similar to visitor id except that it doesn't change over time.
Garbage collector interval
Interval at which expired sessions are collected.
Default: PRISME_SESSIONSTORAGE_GC_INTERVAL=10s
Inactive TTL
The maximum time a session can remain inactive before it expires.
Default: PRISME_SESSIONSTORAGE_SESSION_INACTIVE_TTL=24h
Device expiry percentile
The garbage collector removes expired sessions from a device only after a specified percentage of its total sessions have expired. This threshold helps optimize system performance by batching cleanup operations instead of running them for each individual session expiration.
Default: PRISME_SESSIONSTORAGE_DEVICE_EXPIRY_PERCENTILE=50
By default, sessions associated to a device are collected when 50% of all device's sessions are expired.
Max sessions per device
Maximum number of sessions per device.
Default: PRISME_SESSIONSTORAGE_MAX_SERSSIONS_PER_VISITOR=64