From 84c54a9b467af727f6d8cf0e8ffa003ded166e8c Mon Sep 17 00:00:00 2001 From: Rory Z <16801068+Rory-Z@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:15:50 +0800 Subject: [PATCH] docs: update example Signed-off-by: Rory Z <16801068+Rory-Z@users.noreply.github.com> --- examples/docker-compose/docker-compose.yml | 10 +++-- .../docker-compose/emqx-exporter.config.yaml | 20 +++++++++- examples/docker-compose/prometheus-emqx5.yaml | 39 +++++++++++++++++++ 3 files changed, 64 insertions(+), 5 deletions(-) diff --git a/examples/docker-compose/docker-compose.yml b/examples/docker-compose/docker-compose.yml index 42ffd7d..37b599d 100644 --- a/examples/docker-compose/docker-compose.yml +++ b/examples/docker-compose/docker-compose.yml @@ -4,6 +4,7 @@ services: image: emqx:5 container_name: emqx-demo ports: + - 18084:18084 - 18083:18083 - 1883:1883 - 8083:8083 @@ -11,10 +12,11 @@ services: - 8883:8883 environment: EMQX_API_KEY__BOOTSTRAP_FILE: '"/opt/emqx/data/bootstrap-api"' + EMQX_DASHBOARD__LISTENERS__HTTPS__BIND: 18084 volumes: - ./bootstrap-api:/opt/emqx/data/bootstrap-api healthcheck: - test: ["CMD", "emqx", "ctl", "status"] + test: ["CMD", "emqx", "ping"] interval: 30s timeout: 10s retries: 3 @@ -22,10 +24,10 @@ services: emqx-exporter: depends_on: - emqx - image: emqx-exporter + image: emqx/emqx-exporter:0.2.3 container_name: exporter-demo - # ports: - # - 8085:8085 + ports: + - 8085:8085 volumes: - ./emqx-exporter.config.yaml:/usr/local/emqx-exporter/bin/config.yaml diff --git a/examples/docker-compose/emqx-exporter.config.yaml b/examples/docker-compose/emqx-exporter.config.yaml index b6a4f04..9f5c29a 100644 --- a/examples/docker-compose/emqx-exporter.config.yaml +++ b/examples/docker-compose/emqx-exporter.config.yaml @@ -1,6 +1,24 @@ metrics: - target: emqx-demo:18083 api_key: some_api_key api_secret: some_api_secret + target: emqx-demo:18084 + scheme: https + tls_config: + insecure_skip_verify: true probes: - target: emqx-demo:1883 + - target: emqx-demo:8883 + scheme: tls + client_id: my_demo + username: my_demo + password: my_demo + topic: my_demo + qos: 1 + tls_config: + insecure_skip_verify: true + - target: emqx-demo:8083/mqtt + scheme: ws + - target: emqx-demo:8084/mqtt + scheme: wss + tls_config: + insecure_skip_verify: true diff --git a/examples/docker-compose/prometheus-emqx5.yaml b/examples/docker-compose/prometheus-emqx5.yaml index 0cfa7ac..d1497b0 100644 --- a/examples/docker-compose/prometheus-emqx5.yaml +++ b/examples/docker-compose/prometheus-emqx5.yaml @@ -42,3 +42,42 @@ scrape_configs: cluster: test # fix value, don't modify from: probe + - job_name: 'mqtts-probe' + metrics_path: '/probe' + params: + target: + - "emqx-demo:8883" + scrape_interval: 5s + static_configs: + - targets: [exporter-demo:8085] + labels: + # label the cluster name of where the metrics data from + cluster: test + # fix value, don't modify + from: probe + - job_name: 'ws-probe' + metrics_path: '/probe' + params: + target: + - "emqx-demo:8083/mqtt" + scrape_interval: 5s + static_configs: + - targets: [exporter-demo:8085] + labels: + # label the cluster name of where the metrics data from + cluster: test + # fix value, don't modify + from: probe + - job_name: 'wss-probe' + metrics_path: '/probe' + params: + target: + - "emqx-demo:8084/mqtt" + scrape_interval: 5s + static_configs: + - targets: [exporter-demo:8085] + labels: + # label the cluster name of where the metrics data from + cluster: test + # fix value, don't modify + from: probe \ No newline at end of file