A data collection program developed using Kafka, MongoDB, and Golang.
- programming language: golang, go1.20.4
- logging: uber-go/zap
- metrics: prometheus
- tacing: opentelemetry
- database: mongodb
- message queue: kafka
- RPC: grpc
- docker images
- registry.cn-shanghai.aliyuncs.com/d2jvkpn/collector:dev
- devops:
- docker, docker-compose
- TODO: kubernetes
- service discovery
- TODO: consul
service_name: collector_local
log:
path: logs/collector.log
size_mb: 256
mongodb:
uri: mongodb://root:root@localhost:27017
min_pool_size: 20
max_pool_size: 500
timeout_secs: 5
db: collector
kafka:
addrs: [localhost:9092]
version: 3.4.0
topic: collector
# consumer
group_id: default
# producer
key: key0001
bp:
count: 1000
interval: 1m
metrics:
addr: :5011
prometheus: true
debug: true
otel:
enable: false
addr: otel-collector:4317
grpc:
tls: false
cert: configs/server.pem
key: configs/server.key
go main.go --config=configs/local.yaml --addr=0.0.0.0:5021