Version 0.3.0
Some checks failed
Run linters on applied template / Python 3.13 lint and build (push) Failing after 2m36s

Changes:
- fix double exception message in main request_processing span
- add OpenSearch to Jaeger and OpenTelemetry Logs
- add optional OpenTelemetry Logs Exporter to structlog
- update deploy README
This commit is contained in:
2025-12-06 19:41:33 +03:00
parent 34c1347402
commit b8acb017fd
16 changed files with 966 additions and 450 deletions

View File

@@ -4,7 +4,7 @@ services:
# postgres database
database-init:
image: postgres:17
image: postgres:17 # or postgis/postgis:17-3.5
container_name: {{project_slug}}_db-init
volumes: &postgres-volumes
- ./data/postgres:/var/lib/postgresql/data
@@ -74,7 +74,7 @@ services:
otel: # optional
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${PORT:-8080}/health_check/ping"]
test: ["CMD-SHELL", "curl -f http://localhost:${PORT:-8080}/health_check/ping"]
interval: 10s
timeout: 5s
start_period: 5s
@@ -83,30 +83,41 @@ services:
# prometheus + grafana monitoring
prometheus-init:
image: prom/prometheus:latest
image: alpine:3.23
container_name: prometheus-init
volumes: &prometheus-volumes-section
- ./configs/prometheus.yml:/etc/prometheus/prometheus.yml
- ./data/prometheus:/prometheus
entrypoint: ["chown", "-R", "65534:65534", "/prometheus"]
entrypoint: ["chown", "65534:65534", "-R", "/prometheus"]
user: "root"
prometheus-pushgateway:
image: prom/pushgateway:latest
container_name: prometheus-pushgateway
restart: unless-stopped
# ports:
# - 9091:9091
logging: *json-logging
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
ports:
- 9090:9090
depends_on:
prometheus-init:
condition: service_completed_successfully
volumes: *prometheus-volumes-section
logging: *json-logging
grafana-init:
image: grafana/grafana-enterprise:latest
image: alpine:3.23
container_name: grafana-init
volumes: &grafana-volumes-section
- ./data/grafana:/var/lib/grafana
user: "root"
entrypoint: ["chown", "-R", "472:0", "/var/lib/grafana"]
entrypoint: ["chown", "472:0", "-R", "/var/lib/grafana"]
grafana:
image: grafana/grafana-enterprise:latest
@@ -122,25 +133,74 @@ services:
# jaeger tracing
opensearch-init:
image: alpine:3.23
volumes: &opensearch-volumes-section
- ./data/opensearch:/usr/share/opensearch/data
entrypoint: ["chown", "1000:1000", "-R", "/usr/share/opensearch/data"]
user: "root"
opensearch:
image: opensearchproject/opensearch:3.3.0@sha256:d96afaf6cbd2a6a3695aeb2f1d48c9a16ad5c8918eb849e5cbf43475f0f8e146
container_name: opensearch
environment:
- discovery.type=single-node
- plugins.security.disabled=true
- http.host=0.0.0.0
- transport.host=127.0.0.1
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=admin-Password-1@-goes-here
# ports:
# - 9200:9200 # REST API
# - 9600:9600 # Performance Analyzer
volumes: *opensearch-volumes-section
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:9200 || exit 1" ]
interval: 10s
timeout: 10s
retries: 30
logging: *json-logging
# # Visualizer for opensearch data
# opensearch-dashboards:
# image: opensearchproject/opensearch-dashboards:latest
# container_name: marketplace_os_dashboards
# ports:
# - 5601:5601
# # expose:
# # - "5601"
# environment:
# OPENSEARCH_HOSTS: '["http://opensearch:9200"]'
# DISABLE_SECURITY_DASHBOARDS_PLUGIN: "true"
# depends_on:
# opensearch:
# condition: service_healthy
jaeger:
container_name: jaeger
image: cr.jaegertracing.io/jaegertracing/jaeger:2.11.0
image: cr.jaegertracing.io/jaegertracing/jaeger:2.12.0
ports:
- 16686:16686
# - 5778:5778
# - 9411:9411
volumes:
- ./configs/jaeger-ui.json:/etc/jaeger/jaeger-ui.json
- ./configs/jaeger-opensearch.yaml:/etc/jaeger/config.yml
command: ["--config", "/etc/jaeger/config.yml"]
depends_on:
opensearch:
condition: service_healthy
restart: unless-stopped
logging: *json-logging
otel:
container_name: otel
image: otel/opentelemetry-collector
image: otel/opentelemetry-collector-contrib
# ports:
# - 4317:4317
# - 4318:4318
restart: unless-stopped
volumes:
- ./configs/otel.yaml:/etc/otelcol/config.yaml
- ./configs/otel.yaml:/etc/otelcol-contrib/config.yaml
depends_on:
- jaeger
logging: *json-logging