Skip to content

Commit

Permalink
add instruction docs of trace and metrics in eventmesh (apache#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roc-00 authored Jan 10, 2022
1 parent 30c89ff commit 45a850b
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/cn/instructions/eventmesh-metrics-Prometheus-instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## 通过Prometheus观察metrics

### 1、下载Prometheus
官网:https://prometheus.io/

本地下载Prometheus:https://prometheus.io/download/

选择自己电脑对应的版本下载并解压缩

![Prometheus-download](../../images/Prometheus-download.png)

### 2、在prometheus.yml中添加配置

如果你是Prometheus的新手,可以直接复制eventmesh-runtime/conf/prometheus.yml替换

例如:这是win-64的下载后的样子:

![prometheus-yml](../../images/prometheus-yml.png)

替换红框中的文件

如果你十分了解Prometheus,可以自行配置,eventmesh默认的导出的端口为19090。



ps:如果需要更换端口的话,请修改eventmesh-runtime/conf/eventmesh.properties中的

```properties
#prometheusPort
eventMesh.metrics.prometheus.port=19090
```

### 3、运行Prometheus.exe和eventmesh

双击Prometheus.exe运行

运行eventmesh-starter(参考[eventmesh-runtime-quickstart](eventmesh-runtime-quickstart.md))

运行eventmesh-example(参考[eventmesh-sdk-java-quickstart](eventmesh-sdk-java-quickstart.md))

打开浏览器访问:http://localhost:9090/



### 4、输入你想观察的metrics

输入’**eventmesh_**‘ 就会出现相关的指标的提示

![promethus-search](../../images/promethus-search.png)
45 changes: 45 additions & 0 deletions docs/cn/instructions/eventmesh-trace-Zipkin-instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## 通过Zipkin观察trace

### 1、下载和运行Zipkin

请参考https://zipkin.io/pages/quickstart.html



### 2、运行eventmesh

运行eventmesh-starter(参考[eventmesh-runtime-quickstart](eventmesh-runtime-quickstart.md))

运行eventmesh-example(参考[eventmesh-sdk-java-quickstart](eventmesh-sdk-java-quickstart.md))



### 3、相关的设置

eventmesh-runtime/conf/eventmesh.properties中:

```properties
#trace exporter
eventmesh.trace.exporter.type=Zipkin

#set the maximum batch size to use
eventmesh.trace.exporter.max.export.size=512
#set the queue size. This must be >= the export batch size
eventmesh.trace.exporter.max.queue.size=2048
#set the max amount of time an export can run before getting(TimeUnit=SECONDS)
eventmesh.trace.exporter.export.timeout=30
#set time between two different exports(TimeUnit=SECONDS)
eventmesh.trace.exporter.export.interval=5

#zipkin
eventmesh.trace.export.zipkin.ip=localhost
eventmesh.trace.export.zipkin.port=9411
```

以上都是相关的配置,如果你十分熟悉zipkin的话可以自行修改。



### 4、观察

浏览器打开: **localhost:9411**
49 changes: 49 additions & 0 deletions docs/en/instructions/eventmesh-metrics-Prometheus-instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Observe metrics through Prometheus

### 1、download Prometheus
Official website:https://prometheus.io/

Download Prometheus locally:https://prometheus.io/download/

Select the corresponding version of your computer, download and unzip it

![Prometheus-download](../../images/Prometheus-download.png)

### 2、In Prometheus Add configuration in YML

If you are new to Prometheus, you can copy it directly: eventmesh-runtime/conf/prometheus.yml

For example:this was downloaded in win-64

![prometheus-yml](../../images/prometheus-yml.png)

Replace the file in the red box

If you know Prometheus well, you can configure it yourself. The default export port of eventmesh is 19090.



ps:If the port needs to be replaced, please modify:eventmesh-runtime/conf/eventmesh.properties中的

```properties
#prometheusPort
eventMesh.metrics.prometheus.port=19090
```

### 3、run Prometheus and eventmesh

Double click Prometheus.exe startup

run eventmesh-starter(reference [eventmesh-runtime-quickstart](eventmesh-runtime-quickstart.md))

run eventmesh-example(reference [eventmesh-sdk-java-quickstart](eventmesh-sdk-java-quickstart.md))

Open browser access:http://localhost:9090/



### 4、Enter the metrics you want to observe

input '**eventmesh_**' Relevant indicators will appear

![promethus-search](../../images/promethus-search.png)
45 changes: 45 additions & 0 deletions docs/en/instructions/eventmesh-trace-Zipkin-instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Observe trace through Zipkin

### 1、Download and run Zipkin

Reference:https://zipkin.io/pages/quickstart.html



### 2、Run eventmesh

run eventmesh-starter(reference [eventmesh-runtime-quickstart](eventmesh-runtime-quickstart.md))

run eventmesh-example(reference [eventmesh-sdk-java-quickstart](eventmesh-sdk-java-quickstart.md))



### 3、Related settings

In eventmesh-runtime/conf/eventmesh.properties:

```properties
#trace exporter
eventmesh.trace.exporter.type=Zipkin

#set the maximum batch size to use
eventmesh.trace.exporter.max.export.size=512
#set the queue size. This must be >= the export batch size
eventmesh.trace.exporter.max.queue.size=2048
#set the max amount of time an export can run before getting(TimeUnit=SECONDS)
eventmesh.trace.exporter.export.timeout=30
#set time between two different exports(TimeUnit=SECONDS)
eventmesh.trace.exporter.export.interval=5

#zipkin
eventmesh.trace.export.zipkin.ip=localhost
eventmesh.trace.export.zipkin.port=9411
```

The above are related configurations. If you are familiar with Zipkin, you can modify it yourself.



### 4、Observe

Open browser access: **localhost:9411**
Binary file added docs/images/Prometheus-download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/prometheus-yml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/promethus-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 45a850b

Please sign in to comment.