Add docker and compose config

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-01-16 13:45:38 +01:00
parent 8983a0d7ed
commit b5ddb7d8cf
6 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
apiVersion: 1
deleteDatasources:
- name: "Prometheus"
- name: "Loki"
- name: "Tempo"
datasources:
- name: "Prometheus"
type: "prometheus"
access: "proxy"
url: "http://prometheus:9191"
basicAuth: false
jsonData:
httpMethod: "POST"
manageAlerts: true
prometheusType: "Prometheus"
cacheLevel: 'High'
disableRecordingRules: false
incrementalQueryOverlapWindow: 10m
isDefault: false
version: 1
editable: false
- name: "Loki"
type: "loki"
access: "proxy"
url: "http://loki:3100"
basicAuth: false
version: 1
editable: false
jsonData:
derivedFields:
- datasourceUid: "tempo"
matcherRegex: traceID=(\w+)
name: "TraceID"
url: $${__value.raw}
- name: "Tempo"
type: tempo
access: proxy
url: "http://tempo:3200"
basicAuth: false
isDefault: true
version: 1
editable: false

23
compose/postgres/01_probod.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
psql -v ON_ERROR_STOP=1 -U $POSTGRES_USER <<-EOF
CREATE USER probod;
ALTER USER probod WITH SUPERUSER;
ALTER USER probod PASSWORD 'probod';
CREATE DATABASE probod;
GRANT ALL PRIVILEGES ON DATABASE probod TO probod;
CREATE DATABASE probod_test;
GRANT ALL PRIVILEGES ON DATABASE probod_test TO probod;
EOF
psql -v ON_ERROR_STOP=1 -U $POSTGRES_USER -d probod <<-EOF
ALTER SCHEMA public OWNER TO probod;
GRANT ALL ON SCHEMA public TO probod;
EOF
psql -v ON_ERROR_STOP=1 -U $POSTGRES_USER -d probod_test <<-EOF
ALTER SCHEMA public OWNER TO probod;
GRANT ALL ON SCHEMA public TO probod;
EOF

View File

@@ -0,0 +1,12 @@
global:
scrape_interval: "15s"
evaluation_interval: "15s"
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["host.docker.internal:9090"]
- job_name: "tempo"
static_configs:
- targets: ["tempo:3200"]

41
compose/tempo/tempo.yaml Normal file
View File

@@ -0,0 +1,41 @@
server:
http_listen_port: 3200
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
ingester:
trace_idle_period: "10s"
max_block_bytes: 1_000_000
max_block_duration: "5m"
compactor:
compaction:
compaction_window: "1h"
max_block_bytes: 100_000_000
block_retention: "1h"
compacted_block_retention: "10m"
storage:
trace:
backend: "local"
local:
path: "/var/db/tempo"
block:
bloom_filter_false_positive: .05
v2_index_downsample_bytes: 1000
v2_encoding: "zstd"
wal:
path: "/var/db/tempo/wal"
v2_encoding: "snappy"
pool:
max_workers: 100
queue_depth: 10000
usage_report:
reporting_enabled: false