Skip to content

Commit

Permalink
fix(): conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawven committed Dec 29, 2024
1 parent 55f80ef commit 4538c5a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 10 deletions.
Binary file removed doc/images/apollo-client-monitor-exporter-load.jpg
Binary file not shown.
38 changes: 30 additions & 8 deletions docs/en/client/java-sdk-user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@ The configuration methods, in descending order of priority, are

#### 1.2.4.9 Enable Client Monitoring

> Applicable to version 2.4.0 and above
> For version 2.4.0 and above
After enabling the following configurations, you can use `ConfigService.getConfigMonitor()` to retrieve client monitoring information and enable automatic reporting.

```properties
# 1. Whether to enable the Monitor mechanism, i.e., whether ConfigMonitor is enabled. Default is false.
apollo.client.monitor.enabled = true

# 2. Whether to expose Monitor data in JMX format. When enabled, you can view related information through tools like J-console. Default is false.
# 2. Whether to expose Monitor data by JMX. When enabled, you can view related information through tools like J-console. Default is false.
apollo.client.monitor.jmx.enabled = true

# 3. The maximum number of exception logs that Monitor can store. The default is 25, following the FIFO principle.
Expand Down Expand Up @@ -649,9 +649,9 @@ String value = config.getProperty(someKey, someDefaultValue);
```

### 3.1.6 Retrieve Client Monitoring Metrics
> Applicable to version 2.4.0 and above
> For version 2.4.0 and above
Apollo Client significantly enhanced observability in version 2.4.0, providing the ConfigMonitor API as well as metric export options via JMX and Prometheus. For configuration details, see [1.2.4.9 Enable Client Monitoring](#_1249-开启客户端监控).
Apollo Client significantly enhanced observability since version 2.4.0, providing the ConfigMonitor API as well as metric export options via JMX and Prometheus. For configuration details, see [1.2.4.9 Enable Client Monitoring](#_1249-enable-client-monitoring).

#### 3.1.6.1 Retrieve Monitoring Data via ConfigMonitor

Expand Down Expand Up @@ -686,7 +686,7 @@ After starting the application, use J-console or similar tools to view the metri
![showing Apollo client monitoring metrics in JMX](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.jpg)
#### 3.1.6.3 Client Export Metrics to External Monitoring Systems

Users can customize the integration with monitoring systems such as Prometheus as needed. The client provides an SPI, see [7.2 MetricsExporter Extension](#_7.2_MetricsExporter-extension) for details.
Users can customize the integration with monitoring systems such as Prometheus as needed. The client provides an SPI, see [7.3 Exporting Metrics to Custom Monitoring Systems](#73-exporting-metrics-to-custom-monitoring-systems). for details.

*Related Metrics Data Tables*

Expand Down Expand Up @@ -1504,7 +1504,7 @@ The default service provider is `com.ctrip.framework.apollo.spi.RandomConfigServ


## 7.2 Exporting Metrics to Prometheus
> Applicable to version 2.4.0 and above
> For 2.4.0 and above
Metrics can be exported to Prometheus, or different implementations can be written based on SPI to integrate with various monitoring systems.

Expand Down Expand Up @@ -1637,13 +1637,35 @@ Users need to implement a MetricsExporter by extending `AbstractApolloClientMetr
Additionally, you need to configure the corresponding SPI files.

MetricsExporter Loading Flowchart:
![Exporter load by apollo client](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-exporter-load.jpg)
```mermaid
sequenceDiagram
participant Factory as DefaultMetricsExporterFactory
participant Exporter as MetricsExporter
participant SPI as SPI Loader
%% Step 1: Factory loads all Exporters using SPI
Factory->>SPI: loadAllOrdered(MetricsExporter)
SPI-->>Factory: List<MetricsExporter>
%% Step 2: Factory checks for supported Exporter
Factory->>Exporter: isSupport(externalSystemType)
Exporter-->>Factory: true / false
alt Exporter Found
%% Step 3: Factory initializes the Exporter
Factory->>Exporter: init(listeners, exportPeriod)
Factory-->>Client: Exporter Instance
else No Exporter Found
%% Step 4: Factory returns null
Factory-->>Client: null
end
```

### 7.3.1 SkyWalking Example
By configuring:
```properties
apollo.client.monitor.enabled=true
#exporter内定义
# Defined within the exporter
apollo.client.monitor.external.type=skywalking
```

Expand Down
26 changes: 24 additions & 2 deletions docs/zh/client/java-sdk-user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ apollo.client.monitor.jmx.enabled = true

#### 3.1.6.3 客户端导出指标上报到外部监控系统

用户可以根据需求自定义接入Prometheus等监控系统,客户端提供了SPI,详见 [7.2 MetricsExporter扩展](#_7.2_MetricsExporter扩展)
用户可以根据需求自定义接入Prometheus等监控系统,客户端提供了SPI,详见 [7.3 指标输出到自定义监控系统](#73-指标输出到自定义监控系统)。

*相关指标数据表格*

Expand Down Expand Up @@ -1580,7 +1580,29 @@ apollo_client_thread_pool_completed_task_count{thread_pool_name="AbstractConfig"
并配置相关SPI文件

MetricsExporter加载流程图
![Exporter load by apollo client](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-exporter-load.jpg)
```mermaid
sequenceDiagram
participant Factory as DefaultMetricsExporterFactory
participant Exporter as MetricsExporter
participant SPI as SPI Loader

%% 步骤 1: FactorySPI 加载所有 Exporters
Factory->>SPI: loadAllOrdered(MetricsExporter)
SPI-->>Factory: List<MetricsExporter>

%% 步骤 2: Factory 查找支持的 Exporter
Factory->>Exporter: isSupport(externalSystemType)
Exporter-->>Factory: true / false

alt Exporter Found
%% 步骤 3: Factory 初始化 Exporter
Factory->>Exporter: init(listeners, exportPeriod)
Factory-->>Client: Exporter Instance
else No Exporter Found
%% 步骤 4: Factory 返回 null
Factory-->>Client: null
end
```



Expand Down

0 comments on commit 4538c5a

Please sign in to comment.