Files
baserow/docker-compose.dev.yml
T
Davide Silvestri e6f2a44e85 chore: scale OpenTelemetry sampling and preserve traffic metrics (#5726)
* feat: scale OpenTelemetry sampling and metrics

* feat: add per-user invitation metric

* fix: monitor every queue in OpenTelemetry

* docs: explain retaining every eligible trace

* feat: retain all eligible traces with -1

* fix: address feedback; trace ActionType.do and several important handlers methods
2026-07-22 11:57:11 +02:00

301 lines
10 KiB
YAML

services:
db:
# use lowest supported version for dev to check compatibility
image: pgvector/pgvector:pg${POSTGRES_IMAGE_VERSION:-14}
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_POSTGRES_PORT:-5432}:5432"
command: "${POSTGRES_DEV_EXTRA_ARGS}"
volumes:
# Use a different volume in case the Major version is different from the
# production one to avoid issues.
- pgdatadev:/var/lib/postgresql/data
redis:
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_DEBUG_REDIS_PORT:-6379}:6379"
# Override with the dev caddy file which switches Caddy to only be the media file
# server in the dev env. Devs will instead directly connect to the backend and
# web frontend services.
caddy:
volumes:
- $PWD/Caddyfile.dev:/etc/caddy/Caddyfile
backend:
image: baserow_backend:dev
environment:
- BASEROW_BACKEND_DEBUGGER_ENABLED
- BASEROW_BACKEND_DEBUGGER_PORT=${BASEROW_BACKEND_DEBUGGER_PORT:-5678}
- BASEROW_DANGEROUS_SILKY_ANALYZE_QUERIES
- BASEROW_ENABLE_SILK
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
- OTEL_TRACES_SAMPLER=always_on
- BASEROW_EMBEDDINGS_API_URL=${BASEROW_EMBEDDINGS_API_URL}
build:
dockerfile: ./backend/Dockerfile
context: .
target: dev
args:
# We allow configuring the UID/GID here so you can run as the dev's actual user
# reducing the chance the containers screw up the bind mounted folders.
UID: $UID
GID: $GID
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_BACKEND_HOST_PORT:-8000}:8000"
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_BACKEND_DEBUGGER_PORT:-5678}:${BASEROW_BACKEND_DEBUGGER_PORT:-5678}"
volumes:
- ./docs:/baserow/docs
- ./backend:/baserow/backend
- ./premium/backend/:/baserow/premium/backend
- ./enterprise/backend/:/baserow/enterprise/backend
- ./deploy/plugins/:/baserow/plugins/
- ./tests:/baserow/tests
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
depends_on:
- otel-collector
web-frontend:
image: baserow_web-frontend:dev
build:
dockerfile: ./web-frontend/Dockerfile
context: .
target: dev
args:
# We allow configuring the UID/GID here so you can run as the dev's actual user
# reducing the chance the containers screw up the bind mounted folders.
UID: $UID
GID: $GID
command: "nuxt-dev"
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_WEB_FRONTEND_DEV_PORT:-3000}:3000"
volumes:
- ./web-frontend:/baserow/web-frontend
- ./premium/web-frontend/:/baserow/premium/web-frontend
- ./enterprise/web-frontend/:/baserow/enterprise/web-frontend
- ./tests/:/baserow/tests
- ./deploy/plugins:/baserow/plugins
# dev volumes to avoid polluting your local filesystem with build files or
# overwriting existing node_modules.
- node_modules:/baserow/web-frontend/node_modules
- nuxt:/baserow/web-frontend/.nuxt/
- cache:/baserow/web-frontend/.cache/
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
storybook:
image: baserow_web-frontend:dev
profiles: ["optional"]
build:
dockerfile: ./web-frontend/Dockerfile
context: .
target: dev
args:
# We allow configuring the UID/GID here so you can run as the dev's actual user
# reducing the chance the containers screw up the bind mounted folders.
UID: $UID
GID: $GID
command: "storybook-dev"
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_STORYBOOK_PORT:-6006}:6006"
volumes:
- ./web-frontend:/baserow/web-frontend
- ./premium/web-frontend/:/baserow/premium/web-frontend
- ./enterprise/web-frontend/:/baserow/enterprise/web-frontend
- ./tests/:/baserow/tests
- ./deploy/plugins:/baserow/plugins
# dev volumes to avoid polluting your local filesystem with build files or
# overwriting existing node_modules.
- node_modules:/baserow/web-frontend/node_modules
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
healthcheck:
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://localhost:6006/"]
interval: 60s
timeout: 5s
retries: 3
start_period: 30s
celery:
image: baserow_backend:dev
user: "${UID}:${GID}"
command: "watch-py celery-worker"
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
- OTEL_TRACES_SAMPLER=always_on
- BASEROW_DANGEROUS_SILKY_ANALYZE_QUERIES
volumes:
- ./docs:/baserow/docs
- ./backend:/baserow/backend
- ./premium/backend/:/baserow/premium/backend
- ./enterprise/backend/:/baserow/enterprise/backend
- ./deploy/plugins:/baserow/plugins
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
depends_on:
- otel-collector
celery-export-worker:
image: baserow_backend:dev
user: "${UID}:${GID}"
command: "watch-py celery-exportworker"
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
- OTEL_TRACES_SAMPLER=always_on
- BASEROW_DANGEROUS_SILKY_ANALYZE_QUERIES
volumes:
- ./docs:/baserow/docs
- ./backend:/baserow/backend
- ./premium/backend/:/baserow/premium/backend
- ./enterprise/backend/:/baserow/enterprise/backend
- ./deploy/plugins:/baserow/plugins
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
depends_on:
- otel-collector
celery-beat-worker:
image: baserow_backend:dev
user: "${UID}:${GID}"
command: "watch-py celery-beat"
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
- OTEL_TRACES_SAMPLER=always_on
volumes:
- ./backend:/baserow/backend
- ./premium/backend/:/baserow/premium/backend
- ./enterprise/backend/:/baserow/enterprise/backend
- ./deploy/plugins:/baserow/plugins
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
celery-flower:
image: baserow_backend:dev
user: "${UID}:${GID}"
profiles: ["optional"]
restart: unless-stopped
stop_signal: SIGQUIT
command: "celery-flower"
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:5555 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
environment:
REDIS_HOST:
REDIS_PORT:
REDIS_PROTOCOL:
REDIS_URL:
REDIS_SSL_CERT_REQS:
REDIS_SSL_CA_CERTS:
REDIS_USER:
REDIS_PASSWORD: ${REDIS_PASSWORD:?}
volumes:
- ./backend:/baserow/backend
- ./premium/backend/:/baserow/premium/backend
- ./enterprise/backend/:/baserow/enterprise/backend
- ./deploy/plugins:/baserow/plugins
- media:/baserow/media
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_CELERY_FLOWER_PORT:-5555}:5555" # web ui
networks:
local:
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
mjml-email-compiler:
image: baserow_web-frontend:dev
depends_on:
- web-frontend
user: "${UID}:${GID}"
command: "bash -c 'cd /baserow/backend/email_compiler/ && yarn install && yarn run watch'"
healthcheck:
disable: true
volumes:
- ./backend:/baserow/backend
- ./web-frontend/docker:/baserow/web-frontend/docker
- ./deploy/plugins:/baserow/plugins
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
mailhog:
image: mailhog/mailhog
logging:
driver: "none" # disable saving logs
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_MAILHOG_SMTP_PORT:-1025}:1025" # smtp
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_MAILHOG_WEB_PORT:-8025}:8025" # web ui
networks:
local:
# When switching between dev and local the media files in the media volume will be
# owned by different users. Ensure that we chown them to the user appropriate for the
# environment here.
volume-permissions-fixer:
image: bash:4.4
command: chown ${UID:-9999}:${GID:-9999} -R /baserow/media
volumes:
- media:/baserow/media
- caddy_config:/config
- caddy_data:/data
networks:
local:
otel-collector:
image: otel/opentelemetry-collector-contrib:0.153.0
command:
- "--config=/etc/otel-collector-config.yaml"
- "--feature-gates=processor.tailsamplingprocessor.recordpolicy"
environment:
HONEYCOMB_API_KEY:
HONEYCOMB_METRICS_DATASET: baserow-dev-metrics
BASEROW_OTEL_TAIL_SAMPLING_DECISION_WAIT: ${BASEROW_OTEL_TAIL_SAMPLING_DECISION_WAIT:-5m}
BASEROW_OTEL_TAIL_SAMPLING_DECISION_WAIT_AFTER_ROOT_RECEIVED: ${BASEROW_OTEL_TAIL_SAMPLING_DECISION_WAIT_AFTER_ROOT_RECEIVED:-5s}
BASEROW_OTEL_TAIL_SAMPLING_MAX_SPANS_PER_SECOND: ${BASEROW_OTEL_TAIL_SAMPLING_MAX_SPANS_PER_SECOND:-250}
BASEROW_OTEL_USER_METRICS_CARDINALITY_LIMIT: ${BASEROW_OTEL_USER_METRICS_CARDINALITY_LIMIT:-50000}
BASEROW_OTEL_USER_METRICS_FLUSH_INTERVAL: ${BASEROW_OTEL_USER_METRICS_FLUSH_INTERVAL:-60s}
BASEROW_OTEL_USER_METRICS_SERIES_EXPIRATION: ${BASEROW_OTEL_USER_METRICS_SERIES_EXPIRATION:-5m}
volumes:
- $PWD/deploy/otel/otel-collector-config.yaml:/etc/otel-collector-config.yaml
networks:
local:
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_OTEL_COLLECTOR_PORT:-4318}:4318"
embeddings:
profiles: ["ai"]
build:
context: ./embeddings
dockerfile: Dockerfile
ports:
- "${BASEROW_HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_EMBEDDINGS_PORT:-7999}:80"
networks:
local:
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import requests; requests.get('http://localhost/health').raise_for_status()",
]
interval: 1m30s
timeout: 10s
retries: 3
volumes:
pgdatadev:
node_modules:
nuxt:
storybook:
cache: