Skip to content

Commit

Permalink
fix: new conf entry follow_traceparent
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMoen committed Feb 14, 2025
1 parent a07cba3 commit 59e5f89
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
18 changes: 11 additions & 7 deletions en_US/observability/opentelemetry/e2e-traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The end-to-end tracing feature is supported only in EMQX version 5.8.3 and later

:::

In modern distributed systems, tracking the flow of requests and analyzing performance is essential for ensuring reliability and observability. End-to-end tracing is a concept designed to capture the full path of a request from start to finish, enabling users to gain deep insights into system behavior and performance.
In modern distributed systems, tracking the flow of requests and analyzing performance is essential for ensuring reliability and observability. End-to-end tracing is a concept designed to capture the full path of a request from start to finish, enabling users to gain deep insights into system behavior and performance.

Starting from version 5.8.3, EMQX integrates an OpenTelemetry-based end-to-end tracing feature tailored for the MQTT protocol. This functionality allows users to clearly trace the publishing, routing, and delivery of messages, particularly in multi-node cluster environments. It not only aids in optimizing system performance but also helps in rapid fault localization and enhancing system reliability.

Expand All @@ -36,7 +36,7 @@ This section guides you on how to enable OpenTelemetry-based end-to-end tracing

<img src="./assets/e2e-dashboard-conf-page-en.png" alt="Otel-E2E-Trace-dashboard-page" style="zoom:67%;" />

1. Click **Management** -> **Monitoring** from the Dashboard menu on the left.
1. Click **Management** -> **Monitoring** from the Dashboard menu on the left.
2. Select the **Integration** tab on the Monitoring page.
3. Configure the following settings:
- **Monitoring platform**: Select `OpenTelemetry`.
Expand All @@ -46,17 +46,18 @@ This section guides you on how to enable OpenTelemetry-based end-to-end tracing
- **Trace Mode**: Select `End-to-End` to enable end-to-end tracing functionality.
- **Cluster Identifier**: Add a property value to the span attributes to help identify which EMQX cluster the data comes from. The property key will be `cluster.id`. Typically, set a simple and easily identifiable name or use the cluster name to differentiate between EMQX clusters. The default is `emqxcl`.
- **Traces Export Interval**: Set the time interval for exporting trace data, with a default of `5` seconds.

- **Max Queue Size**: Set the maximum size of the trace data queue, the default is `2048` entries.

4. Click **Trace Advanced Configuration** to configure advanced settings if necessary.

- **Trace Configuration**: Used to set additional trace options, including whether to trace specific events (such as client connections, message transmissions, etc.).
- **Follow Traceparent**: Set whether to follow `traceparent`. When set to `true`, EMQX will try to get `traceparent` from the `User-Property` passed in by the client and associate the end-to-end trace with it. Otherwise, EMQX will generate a new Trace for the end-to-end trace. The default value is `true`.
- **Client ID White List**: Set a whitelist to restrict which clients' connections or messages will be traced. This can help avoid unnecessary tracing and reduce additional system resource consumption.
- **Topic White List**: Set a topic whitelist, allowing only matching topics to be traced. This works similarly to the client whitelist, helping to control the scope of the tracing.

Click **Confirm** after you save the configuration and close the window.

5. Click **Save Changes** to save the configuration.
5. Click **Save Changes** to save the configuration.

### Configure End-to-End Tracing via Configuration File

Expand All @@ -73,11 +74,11 @@ opentelemetry {
trace_mode = e2e
# End-to-end tracing options
e2e_tracing_options {
## Track client connection/disconnection events
## Trace client connection/disconnection events
client_connect_disconnect = true
## Track client messaging events
## Trace client messaging events
client_messaging = true
## Track client subscription/unsubscription events
## Trace client subscription/unsubscription events
client_subscribe_unsubscribe = true
## Maximum whitelist length for client IDs
clientid_match_rules_max = 30
Expand All @@ -90,6 +91,9 @@ opentelemetry {
## Sampling rate for events not in the whitelist
## Note: Sampling applies only when tracing is enabled
sample_ratio = "100%"
## Follow traceparent
## Whether end-to-end tracing follows the `traceparent` passed in by the client
follow_traceparent
}
}
max_queue_size = 50000
Expand Down
9 changes: 6 additions & 3 deletions zh_CN/observability/opentelemetry/e2e-traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
- **追踪模式**:选择 `End-to-End` 以启用端到端追踪功能。
- **集群标识符**:添加到跨度属性中的属性值,帮助识别数据是来自哪个 EMQX 集群。属性键将是 `cluster.id`。通常,设置一个简单且易于识别的名称或使用集群名称来标识不同的 EMQX 集群。默认为 `emqxcl`
- **追踪导出间隔**:设置追踪数据导出的时间间隔,默认为 `5` 秒。
- **最大队列长度**:设置追踪数据队列的最大长度,默认为 `2048` 条。

4. 点击**追踪高级配置**,根据需要进行高级设置。参考[通过配置文件配置端对端追踪](#通过配置文件配置端对端追踪)中的配置示例。

- **追踪配置**:用于设置其他追踪选项,包括是否追踪特定事件(如客户端连接、消息传输等)。

- **客户端 ID 白名单**:设置一个白名单,以限制哪些客户端的连接或消息会被追踪。可以避免不必要的追踪以降低额外的系统资源消耗。

- **跟随 Traceparent**:设置是否跟随 `traceparent`,设置为 `true` 时 EMQX 将尝试从客户端传入的 `User-Property` 中获取 `traceparent` 并将端到端追踪与之关联。否则 EMQX 将为端到端追踪生成新的 Trace。默认为 `true`
- **客户端 ID 白名单**:设置一个客户端 ID 白名单,以限制哪些客户端的连接或消息会被追踪。可以避免不必要的追踪以降低额外的系统资源消耗。
- **主题白名单**:设置一个主题白名单,只有匹配的主题才能被追踪,类似于客户端白名单的作用,帮助控制追踪的范围。

5. 点击**确认**保存配置并关闭窗口。
Expand Down Expand Up @@ -90,6 +90,9 @@ opentelemetry {
## 采样率,即除白名单以外追踪事件的采样率
## Note: 仅当追踪事件开启时才根据采样率进行采样
sample_ratio = "100%"
## 跟随 traceparent
## 端到端追踪是否跟随客户端传入的 traceparent
follow_traceparent
}
}
max_queue_size = 50000
Expand Down

0 comments on commit 59e5f89

Please sign in to comment.