mattermost/server/config.mk

36 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

# Do not modify this file, if you want to configure your own environment copy
# this file in config.override.mk and modify that file, or defining environment
# variables using the same names found here.
# Enable services to be run in docker.
#
# Possible options: postgres, minio, azurite, inbucket, openldap, dejavu,
# keycloak, elasticsearch, opensearch, redis, prometheus,
MM-67668: Replace Promtail with OpenTelemetry collector (#35381) * Add container name to Docker logs This will allow for querying Loki by container's name: {job="docker",container_name="mattermost-postgres"} * Configue Loki to prepare for OTLP ingestion - Add a volume to Loki container to get the config - Configure Loki with the expected labels so that we can query by job, app, container.name... * Add OpenTelemetry collector configuration There are three pipelines: 1. logs/mattermost scrapes the logs from mattermost.log, parsing the timestamp and severity, and pushes them to Loki. 2. logs/docker scrapes the Docker logs from *-json.log, parsing the timestamp, the log itself and the container name, and pushes them to Loki. 3. metrics/docker scrapes the Docker socket to retrieve the containers' uptime values and pushes them to Prometheus. * Replace Promtail with OpenTelemetry collector * Update build tooling for OpenTelemetry collector 1. Make sure that the logs directory is created 2. Swap Promtail with OpenTelemetry collector * Scrape collector to get Docker stats Prometheus needs to scrape the OpenTelemetry collector in the exposed port to get the Docker stats, so that we can query the uptime with metric container_uptime_seconds, which has a container_name label to filter by container. * Update Grafana dashboard for Docker health checks 1. Use Prometheus as the datasource in all queries 2. Simplify the mappings to either 0 (offline, red) or 1 (online, green). 3. Unify all queries on container_uptime_seconds, filtering by container_name, and making sure that the latest value we got is at most 15 seconds old, so that it does not show stale data. 4. Add Redis health check, that was missing 5. Update the dashboard title to Docker containers * Tune Loki and OTel collector configs for local dev - Switch filelog receivers to start_at: beginning so existing logs are ingested on collector startup, not just new entries. - Fix Docker log timestamp layout to use 9s (variable-length nanos) instead of 0s (fixed-width), matching actual Docker JSON log format. - Add ingester max_chunk_age to keep chunks open longer in the single-instance dev setup, so that we can ingest older logs (the window is max_chunk_age/2). - Relax Loki limits for local development: allow unordered writes, disable old-sample rejection, and raise ingestion rate/burst to 64 MB to avoid throttling during bulk ingest.
2026-02-27 10:48:17 -05:00
# grafana, loki and otel-collector.
#
# Must be space separated names.
#
# Example: postgres elasticsearch
MM-67668: Replace Promtail with OpenTelemetry collector (#35381) * Add container name to Docker logs This will allow for querying Loki by container's name: {job="docker",container_name="mattermost-postgres"} * Configue Loki to prepare for OTLP ingestion - Add a volume to Loki container to get the config - Configure Loki with the expected labels so that we can query by job, app, container.name... * Add OpenTelemetry collector configuration There are three pipelines: 1. logs/mattermost scrapes the logs from mattermost.log, parsing the timestamp and severity, and pushes them to Loki. 2. logs/docker scrapes the Docker logs from *-json.log, parsing the timestamp, the log itself and the container name, and pushes them to Loki. 3. metrics/docker scrapes the Docker socket to retrieve the containers' uptime values and pushes them to Prometheus. * Replace Promtail with OpenTelemetry collector * Update build tooling for OpenTelemetry collector 1. Make sure that the logs directory is created 2. Swap Promtail with OpenTelemetry collector * Scrape collector to get Docker stats Prometheus needs to scrape the OpenTelemetry collector in the exposed port to get the Docker stats, so that we can query the uptime with metric container_uptime_seconds, which has a container_name label to filter by container. * Update Grafana dashboard for Docker health checks 1. Use Prometheus as the datasource in all queries 2. Simplify the mappings to either 0 (offline, red) or 1 (online, green). 3. Unify all queries on container_uptime_seconds, filtering by container_name, and making sure that the latest value we got is at most 15 seconds old, so that it does not show stale data. 4. Add Redis health check, that was missing 5. Update the dashboard title to Docker containers * Tune Loki and OTel collector configs for local dev - Switch filelog receivers to start_at: beginning so existing logs are ingested on collector startup, not just new entries. - Fix Docker log timestamp layout to use 9s (variable-length nanos) instead of 0s (fixed-width), matching actual Docker JSON log format. - Add ingester max_chunk_age to keep chunks open longer in the single-instance dev setup, so that we can ingest older logs (the window is max_chunk_age/2). - Relax Loki limits for local development: allow unordered writes, disable old-sample rejection, and raise ingestion rate/burst to 64 MB to avoid throttling during bulk ingest.
2026-02-27 10:48:17 -05:00
ENABLED_DOCKER_SERVICES ?= postgres inbucket redis prometheus grafana loki otel-collector
# Disable entirely the use of docker
MM_NO_DOCKER ?= false
# Run the server in the background
RUN_SERVER_IN_BACKGROUND ?= true
# Data loaded by default in openldap when container starts.
#
# Possible options: test or qa
LDAP_DATA ?= test
# Mock the CWS.
MM_ENABLE_CWS_MOCK ?= false
# Skip running setup-go-work automatically.
# IGNORE_GO_WORK_IF_EXISTS is supported for backwards compatibility.
ifdef IGNORE_GO_WORK_IF_EXISTS
SKIP_SETUP_GO_WORK ?= $(IGNORE_GO_WORK_IF_EXISTS)
endif
SKIP_SETUP_GO_WORK ?= false