Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docker/telemetry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Telemetry Deployment Demo for AutoMQ for Kafka
This module provides a demo for deploying multiple telemetry services (OTel Collector, Prometheus, Tempo, Grafana)
for AutoMQ for Kafka.

### Quick Start
1. (Optional) set environment variables for data storage
```
export $DATA_PATH=/tmp/telemetry
```
2. start services
```
./install.sh start
```
3. direct to Grafana UI to view default dashboard
```
http://${hostname}:3000
```
4. stop and clean up
```
./install.sh remove
```

### Configuration for AutoMQ for Kafka
1. add telemetry configuration to configuration file
```
# enable metrics recording
s3.telemetry.metrics.enable=true

# use OTLP exporter to export metrics to OTel Collector
s3.telemetry.metrics.exporter.type=otlp

# enable tracing
s3.telemetry.tracer.enable=true
s3.telemetry.tracer.span.scheduled.delay.ms=1000
s3.telemetry.tracer.span.max.queue.size=5120
s3.telemetry.tracer.span.max.batch.size=1024

# OTel Collector endpoint
s3.telemetry.exporter.otlp.endpoint=http://${your_host_name}:4317
# Metrics report interval
s3.telemetry.exporter.report.interval.ms=5000
```
2. start AutoMQ for Kafka and metrics and traces will be ready to view on Grafana
60 changes: 60 additions & 0 deletions docker/telemetry/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: '3'
services:
grafana:
image: grafana/grafana-enterprise
container_name: grafana
restart: unless-stopped
user: '0'
ports:
- "3000:3000"
environment:
- GF_PATHS_CONFIG=/etc/grafana/grafana.ini
volumes:
- ${DATA_PATH}/grafana/data:/var/lib/grafana
- ./grafana/grafana.ini:/etc/grafana/grafana.ini
- ./grafana/provisioning:/etc/grafana/provisioning
depends_on:
- prometheus
extra_hosts:
- "host.docker.internal:host-gateway"
prometheus:
image: prom/prometheus
ports:
- 9090:9090
user: '0'
command:
- "--storage.tsdb.retention.time=3d" # set the expire time to three day
- "--config.file=/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
volumes:
- ./prometheus/prometheus.yml:/prometheus/prometheus.yml
- ${DATA_PATH}/prometheus/data:/prometheus
depends_on:
- otel-collector
extra_hosts:
- "host.docker.internal:host-gateway"
otel-collector:
image: otel/opentelemetry-collector-contrib
volumes:
- ./otel/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the Collector
- 8890:8890 # Prometheus exporter metrics
- 13133:13133 # health_check extension
- 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
extra_hosts:
- "host.docker.internal:host-gateway"
tempo:
image: grafana/tempo:latest
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- ./tempo/tempo.yaml:/etc/tempo.yaml
- ${DATA_PATH}/tempo/data:/tmp/tempo
ports:
- "3200:3200" # tempo
- "9095:9095" # tempo grpc
- "4320:4320" # otlp grpc
extra_hosts:
- "host.docker.internal:host-gateway"
5 changes: 5 additions & 0 deletions docker/telemetry/grafana/grafana.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[paths]
provisioning = /etc/grafana/provisioning

[dashboards]
default_home_dashboard_path = /etc/grafana/provisioning/dashboards/automq-for-kafka-dashboard.json
Loading