zeebe 默认已经集成了prometheus,以下是一个简单的配置,关于grafana 的集成需要调整下
dashboard,目前网上的已经太老了
docker-compose 文件
version: "3"
services:
worker:
build: ./
operate:
image: camunda/operate:1.1.0
ports:
- "8080:8080"
volumes:
- "./application.yml:/usr/local/operate/config/application.yml"
grafana:
image: grafana/grafana
ports:
- "3000:3000"
prometheus:
image: prom/prometheus
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
broker-1:
image: camunda/zeebe:${ZEEBE_VERSION:-latest}
ports:
- 26500:26500
- 26501:26501
- 5701:5701
- 9600:9600
environment:
- ZEEBE_LOG_LEVEL=${ZEEBE_LOG_LEVEL:-debug}
- ZEEBE_NODE_ID=0
- ZEEBE_PARTITIONS_COUNT=3
- ZEEBE_CLUSTER_SIZE=3
- ZEEBE_REPLICATION_FACTOR=3
volumes:
- ./broker_1:/usr/local/zeebe/data
- ./zeebe.cfg.toml:/usr/local/zeebe/conf/zeebe.cfg.toml
broker-2:
image: camunda/zeebe:${ZEEBE_VERSION:-latest}
ports:
- 26510:26500
- 9601:9600
environment:
- ZEEBE_LOG_LEVEL=${ZEEBE_LOG_LEVEL:-debug}
- ZEEBE_NODE_ID=1
- ZEEBE_PARTITIONS_COUNT=3
- ZEEBE_CLUSTER_SIZE=3
- ZEEBE_REPLICATION_FACTOR=3
- ZEEBE_CONTACT_POINTS=broker-1:26502
volumes:
- ./broker_2:/usr/local/zeebe/data
- ./zeebe.cfg.toml:/usr/local/zeebe/conf/zeebe.cfg.toml
broker-3:
image: camunda/zeebe:${ZEEBE_VERSION:-latest}
ports:
- 26520:26500
- 9602:9600
environment:
- ZEEBE_LOG_LEVEL=${ZEEBE_LOG_LEVEL:-debug}
- ZEEBE_NODE_ID=2
- ZEEBE_PARTITIONS_COUNT=3
- ZEEBE_CLUSTER_SIZE=3
- ZEEBE_REPLICATION_FACTOR=3
- ZEEBE_CONTACT_POINTS=broker-1:26502
volumes:
- ./broker_3:/usr/local/zeebe/data
- ./zeebe.cfg.toml:/usr/local/zeebe/conf/zeebe.cfg.toml
elasticsearch:
image: elasticsearch:6.7.1
container_name: elasticsearch
environment:
- "discovery.type=single-node"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200:9200
- 9300:9300 # required for Performance Analyzer
operate 应用配置
application.yml 文件
# Operate configuration file
camunda.operate:
# ELS instance to store Operate data
elasticsearch:
# Cluster name
clusterName: elasticsearch
# Host
host: elasticsearch
# Transport port
port: 9200
# Zeebe instance
zeebe:
# Broker contact point
brokerContactPoint: broker-1:26500
# ELS instance to export Zeebe data to
zeebeElasticsearch:
# Cluster name
clusterName: elasticsearch
# Host
host: elasticsearch
# Transport port
port: 9200
# Index prefix, configured in Zeebe Elasticsearch exporter
prefix: zeebe-record
logging:
level:
ROOT: INFO
org.camunda.operate: DEBUG
#Spring Boot Actuator endpoints to be exposed
management.endpoints.web.exposure.include: health,info,conditions,configprops,prometheus
prometheus 配置
prometheus.yml 文件
scrape_configs:
- job_name: brokers
metrics_path: /metrics
scrape_interval: 10s
scrape_timeout: 10s
static_configs:
- targets: ['broker-1:9600','broker-2:9600','broker-3:9600']
zeebe 配置
[gateway]
# Enable the embedded gateway to start on broker startup.
# This setting can also be overridden using the environment variable ZEEBE_EMBED_GATEWAY.
# enable = true
[gateway.network]
[gateway.cluster]
[gateway.threads]
[gateway.monitoring]
[network]
[network.commandApi]
[network.internalApi]
# Overrides the host used for internal broker-to-broker communication
# host = "localhost"
# Sets the port used for internal broker-to-broker communication
# port = 26502
[network.monitoringApi]
# Overrides the host used for exposing monitoring information
host = "0.0.0.0"
# Sets the port used for exposing monitoring information
port = 9600
[data]
[cluster]
[threads]
[[exporters]]
id = "elasticsearch"
className = "io.zeebe.exporter.ElasticsearchExporter"
[exporters.args]
url = "http://elasticsearch:9200"
[exporters.args.bulk]
delay = 5
size = 1_000
[exporters.args.authentication]
[exporters.args.index]
prefix = "zeebe-record"
# createTemplate = true
command = false
event = true
rejection = false
deployment = true
error = true
incident = true
job = true
jobBatch = false
message = false
messageSubscription = false
variable = true
variableDocument = false
workflowInstance = true
workflowInstanceCreation = false
workflowInstanceSubscription = false
参考资料
https://github.com/rongfengliang/zeebe-cluster-docker-compose
https://github.com/zeebe-io/zeebe
https://docs.zeebe.io/operations/metrics.html