Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
warning-explosive committed Mar 29, 2023
1 parent aa80a1c commit b24d392
Show file tree
Hide file tree
Showing 7 changed files with 427 additions and 17 deletions.
138 changes: 122 additions & 16 deletions docker-compose-webtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,149 @@ services:
postgres:
image: postgres:15.1-alpine
container_name: postgres
restart: unless-stopped
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_connections=200
volumes:
- ./postgres-init.sql:/docker-entrypoint-initdb.d/postgres-init.sql
environment:
- POSTGRES_PASSWORD=Password12!
ports:
- '5432:5432'
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "postgres", "-U", "postgres" ]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M

# Postgres exporter
postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter:v0.12.0
container_name: postgres-exporter
command:
- --config.file=/etc/postgres-exporter/postgres-exporter.yaml
- --extend.query-path=/etc/postgres-exporter/postgres-exporter-queries.yaml
volumes:
- ./postgres-exporter.yaml:/etc/postgres-exporter/postgres-exporter.yaml
- ./postgres-exporter-queries.yaml:/etc/postgres-exporter/postgres-exporter-queries.yaml
environment:
- DATA_SOURCE_URI=postgres:5432?sslmode=disable
- DATA_SOURCE_USER=postgres
- DATA_SOURCE_PASS=Password12!
ports:
- '9187:9187'
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M

# RabbitMQ
rabbit:
image: rabbitmq:3.11.11-management-alpine
image: rabbitmq:3.11.11-alpine
container_name: rabbit
restart: unless-stopped
volumes:
- ./rabbitmq-enabled-plugins:/etc/rabbitmq/enabled_plugins
ports:
- '15672:15672'
- '5672:5672'

# Jaeger
jaeger:
image: jaegertracing/all-in-one:1.43.0
container_name: jaeger
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M

# Prometheus
prometheus:
image: quay.io/prometheus/prometheus:v2.43.0
container_name: prometheus
command:
- --web.console.templates=/etc/prometheus/consoles
- --web.console.libraries=/etc/prometheus/console_libraries
- --storage.tsdb.retention.time=1h
- --config.file=/etc/prometheus/prometheus-config.yaml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
- --web.route-prefix=/
- --enable-feature=exemplar-storage
volumes:
- ./prometheus-config.yaml:/etc/prometheus/prometheus-config.yaml
ports:
- '5778:5778' # serve configs (sampling, etc.)
- '16686:16686' # serve frontend
- '14250:14250' # accept model.proto
- "9090:9090"
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M

# OpenTelemetry collector
otel-collector:
image: otel/opentelemetry-collector:0.74.0
image: otel/opentelemetry-collector-contrib:0.74.0
container_name: otel-collector
command: [ --config=/etc/otel-collector-config.yaml ]
command:
- --config=/etc/otel-collector-config.yaml
- --feature-gates=service.connectors
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- '13133:13133' # health_check extension
- '4317:4317' # OTLP gRPC receiver
- '4318:4318' # OTLP http receiver
- "9464:9464" # Prometheus exporter
- "8888:8888" # metrics endpoint
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M

# Jaeger
jaeger:
image: jaegertracing/all-in-one:1.43.0
container_name: jaeger
command:
- "--memory.max-traces"
- "1000"
- "--query.base-path"
- "/jaeger/ui"
environment:
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=prometheus:9090
- PROMETHEUS_TLS_Enabled=false
ports:
- '5778:5778' # serve configs (sampling, etc.)
- '16686:16686' # serve frontend
- '14250:14250' # accept model.proto
restart: unless-stopped
depends_on:
- postgres
- rabbit
- jaeger
- prometheus
deploy:
resources:
limits:
memory: 512M

## Test web-app
#web-app:
# depends_on:
# - postgres
# - rabbit
# - jaeger
# build:
# dockerfile: Dockerfile.webtest
# context: .
# restart: unless-stopped
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# ports:
# - '5000:80'
21 changes: 20 additions & 1 deletion otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,30 @@ exporters:
endpoint: "jaeger:14250"
tls:
insecure: true
prometheusremotewrite:
endpoint: "prometheus:9090/api/v1/write"
target_info:
enabled: true

connectors:
spanmetrics:
histogram:
explicit:
buckets: [100us, 1ms, 2ms, 6ms, 10ms, 100ms, 250ms]
dimensions:
- name: http.method
default: GET
- name: http.status_code
dimensions_cache_size: 1000
aggregation_temporality: "AGGREGATION_TEMPORALITY_CUMULATIVE"

service:
extensions: [memory_ballast]
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [jaeger]
exporters: [jaeger, spanmetrics]
metrics:
receivers: [ spanmetrics ]
exporters: [ prometheusremotewrite ]
Loading

0 comments on commit b24d392

Please sign in to comment.