Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]OSPP-Add more observability in apollo config client #5229

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Rawven
Copy link

@Rawven Rawven commented Sep 10, 2024

What's the purpose of this PR

related pr apolloconfig/apollo-java#74
XXXXX

Which issue(s) this PR fixes:

Fixes #

Brief changelog

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

Summary by CodeRabbit

  • New Features

    • Enhanced client monitoring capabilities for Apollo client version 2.4.0 and above.
    • New sections added to the user guide detailing configuration for monitoring, including specific properties for enabling monitoring and exporting metrics.
    • Introduction of custom metrics exporters, particularly for Prometheus.
  • Documentation

    • Updated user guides in both English and Chinese with expanded content, examples, and clarifications for better usability.
    • Added introductory notes and detailed instructions for environment requirements and mandatory settings.
    • Included guidance on new configuration properties related to monitoring and metrics collection.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 10, 2024
Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Walkthrough

The pull request updates the java-sdk-user-guide.md documents in both English and Chinese to enhance the Apollo client documentation. Key changes include the addition of new sections on monitoring capabilities for version 2.4.0 and above, detailing configuration settings and usage examples. The documents now specify environment requirements, mandatory settings, and optional settings, along with new configuration keys for monitoring features. These updates provide comprehensive guidance for users, particularly developers and maintainers of Apollo systems.

Changes

File Path Change Summary
docs/en/client/java-sdk-user-guide.md - Added introductory note for target audience.
- Expanded "Environment requirements" and "Mandatory settings".
- Introduced new subsections under "Optional settings".
- Added "Monitor-related Configuration" section with new configuration keys.
- Updated "Client Usage" section with new examples.
docs/zh/client/java-sdk-user-guide.md - Enhanced client monitoring capabilities section.
- Detailed configuration for monitoring properties.
- Introduced custom metrics exporters for Prometheus.
- Provided guidance on apollo.override-system-properties.

Possibly related PRs

  • feat: ConfigService cache record stats #5247: This PR introduces new configuration keys related to monitoring capabilities, which aligns with the enhancements made in the main PR regarding the apollo.client.monitor settings and their documentation.
  • fix:Optimize the default log path configuration #5251: Although primarily focused on log path configuration, this PR's changes to configuration files may indirectly relate to the overall configuration management discussed in the main PR, particularly in the context of improving user guidance on configuration settings.

Suggested labels

lgtm

Suggested reviewers

  • nobodyiam

Poem

🐰 In the garden of code, we hop and we play,
With monitoring features, brightening the way.
New keys for the client, like jewels in a crown,
Enhancing our guide, never let us down!
So gather 'round, friends, let’s cheer and rejoice,
For Apollo's new features, we all have a voice! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (3)
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (3)

Line range hint 411-411: Add alternate text to the image.

Images should have alternate text for accessibility.

Add meaningful alternate text within the [] in the image markdown. For example:

![Meaningful alt text describing the image](https://cdn.jsdelivr.net/gh/Rawven/image@main/2024-08-24-14-59-01-image.png)
Tools
LanguageTool

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)


Line range hint 542-542: Add alternate text to the image.

Images should have alternate text for accessibility.

Add meaningful alternate text within the [] in the image markdown. For example:

![Meaningful alt text describing the image](https://raw.githubusercontent.com/Rawven/image/main/20240828003803.png)
Tools
LanguageTool

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)


Line range hint 576-576: Specify the language for the fenced code block.

Fenced code blocks should have a language specified for proper syntax highlighting.

Add the language after the opening triple backticks. For example:

```properties
# TYPE apollo_client_thread_pool_queue_remaining_capacity gauge
...
Tools
LanguageTool

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 31e6486 and 15f108b.

Files selected for processing (2)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
  • docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (1 hunks)
Additional context used
LanguageTool
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

Markdownlint
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md

141-141: null
Bare URL used

(MD034, no-bare-urls)

docs/zh/client/java-sdk-user-guide.md

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


576-576: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


542-542: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


659-659: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

Additional comments not posted (1)
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (1)

Line range hint 415-415:

Tools
LanguageTool

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)


同时查看Prometheus控制台也能看到如下信息

![](https://raw.githubusercontent.com/Rawven/image/main/20240910002345.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alternate text to the image.

Images should have alternate text for accessibility.

Add meaningful alternate text within the [] in the image markdown. For example:

![Meaningful alt text describing the image](https://raw.githubusercontent.com/Rawven/image/main/20240910002345.png) 
Tools
Markdownlint

659-659: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

@Rawven
Copy link
Author

Rawven commented Sep 10, 2024

@Anilople PTAL

@Anilople
Copy link
Contributor

可以先搞定中文文档,最后再翻译到英文文档中

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (1)

139-142: Convert the bare URL to a Markdown link.

To improve the readability and consistency of the document, consider converting the bare URL to a proper Markdown link.

Apply this diff to convert the bare URL to a Markdown link:

-完整代码:https://github.com/apolloconfig/apollo-java/main/master/apollo-plugin/apollo-plugin-client-prometheus/src/main/java
-/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java
+完整代码:[PrometheusApolloClientMetricsExporter.java](https://github.com/apolloconfig/apollo-java/main/master/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java)
Tools
Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)

docs/zh/client/java-sdk-user-guide.md (2)

411-412: Add alternate text to the image.

The image showing the JMX monitoring data is relevant. However, please add meaningful alternate text within the [] in the image markdown to improve accessibility. For example:

![Meaningful alt text describing the image](https://cdn.jsdelivr.net/gh/Rawven/image@main/2024-08-24-14-59-01-image.png)
Tools
Markdownlint

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


415-416: Improve sentence structure for clarity.

The explanation of the apollo.client.monitor.external.type configuration property and its usage for enabling exporters is informative. The flexibility of using officially provided or self-implemented MetricsExporter SPI is also mentioned.

However, the sentence structure could be slightly improved for better clarity, especially the part "这种设计是为了用户能更方便的扩展". Consider rephrasing it as:

这种设计是为了让用户能更方便地扩展。

The addition of "地" makes the sentence more grammatically correct and easier to understand.

Tools
LanguageTool

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 15f108b and 7227498.

Files selected for processing (2)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
  • docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (1 hunks)
Additional context used
LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

docs/zh/extension/java-client-how-to-use-custom-monitor-system.md

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

Markdownlint
docs/zh/client/java-sdk-user-guide.md

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


576-576: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


542-542: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


656-656: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/extension/java-client-how-to-use-custom-monitor-system.md

141-141: null
Bare URL used

(MD034, no-bare-urls)

Additional comments not posted (12)
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (5)

3-42: LGTM!

The section provides a clear example of creating a custom metrics exporter for Prometheus by extending the AbstractApolloClientMetricsExporter class. The code snippet effectively illustrates the structure of the custom exporter.


44-69: LGTM!

The section clearly explains the purpose of the doInit method in the custom exporter class and when it is called. The code snippets provide helpful context and an example implementation for initializing the Prometheus CollectorRegistry and cache map.


71-80: LGTM!

The section clearly explains the purpose of the isSupport method in the custom exporter class and when it is called by DefaultApolloClientMetricsExporterFactory via SPI. The example implementation is straightforward and easy to understand.


82-121: LGTM!

The section clearly explains the purpose of the registerOrUpdateCounterSample and registerOrUpdateGaugeSample methods in the custom exporter class for registering Counter and Gauge type metrics. The example implementations using the Prometheus client library are straightforward and easy to understand.

Tools
LanguageTool

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)


123-137: LGTM!

The section clearly explains the purpose of the response method in the custom exporter class and how the exported data is used by ConfigMonitor. The example implementation using the Prometheus TextFormat to write the metrics data is straightforward and easy to understand.

docs/zh/client/java-sdk-user-guide.md (7)

402-403: LGTM!

The section introduction for monitoring related configurations looks good.


404-406: Looks good!

The context about the enhanced observability features in version 2.4.0 is clear and informative.


407-408: Configuration prerequisite is clear.

The requirement to set apollo.client.monitor.enabled to true for enabling the monitor feature is clearly mentioned.


409-410: JMX configuration property is clear.

The apollo.client.monitor.jmx.enabled property for exposing monitor data via JMX is clearly mentioned.


413-414: Exception queue size configuration is clear.

The apollo.client.monitor.exception-queue-size property for setting the maximum number of exceptions stored by the monitor, along with its default value, is clearly mentioned.


417-418: Reference to detailed usage section is helpful.

Providing a reference to the "Extension Development - Java Client Access to Different Monitoring Systems" section for specific usage details is helpful for users to find more information.


419-420: Export period configuration is clear.

The apollo.client.monitor.external.export-period property for controlling the frequency of the scheduled task that exports status information from the monitor, along with its default value, is clearly mentioned.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 22, 2024
Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.20%. Comparing base (f55b419) to head (2a595bb).
Report is 14 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5229      +/-   ##
============================================
+ Coverage     50.30%   51.20%   +0.90%     
- Complexity     2013     2097      +84     
============================================
  Files           388      393       +5     
  Lines         12228    12438     +210     
  Branches       1209     1229      +20     
============================================
+ Hits           6151     6369     +218     
+ Misses         5712     5681      -31     
- Partials        365      388      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Outside diff range and nitpick comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

415-416: Consider rephrasing the sentence for better readability.

The sentence "这种设计是为了用户能更方便的扩展" could be rephrased as "这种设计是为了用户能更方便地扩展" for better readability.

Tools
LanguageTool

[uncategorized] ~415-~415: 动词的修饰一般为'形容词(副词)+地+动词'。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

Tools
LanguageTool

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7227498 and 254c449.

Files selected for processing (4)
  • docs/en/client/java-sdk-user-guide.md (4 hunks)
  • docs/en/extension/java-client-how-to-use-custom-monitor-system.md (1 hunks)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
  • docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (1 hunks)
Additional context used
LanguageTool
docs/en/client/java-sdk-user-guide.md

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~430-~430: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~434-~434: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)

docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

docs/zh/extension/java-client-how-to-use-custom-monitor-system.md

[uncategorized] ~82-~82: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

Markdownlint
docs/en/client/java-sdk-user-guide.md

604-604: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


573-573: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


684-684: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/en/extension/java-client-how-to-use-custom-monitor-system.md

141-141: null
Bare URL used

(MD034, no-bare-urls)

docs/zh/client/java-sdk-user-guide.md

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


576-576: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


542-542: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


656-656: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/extension/java-client-how-to-use-custom-monitor-system.md

141-141: null
Bare URL used

(MD034, no-bare-urls)

Additional comments not posted (18)
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (5)

1-2: Helpful overview!

The introduction provides a clear and concise overview of the new metrics collection and export feature in the Java client. It sets the context for the changes introduced in this file.


9-40: LGTM!

The PrometheusApolloClientMetricsExporter class structure and method signatures are well-defined. The class extends the appropriate base class and implements the required interface. The method names are descriptive and follow the naming conventions.


60-68: Initialization looks good!

The doInit() method correctly initializes the CollectorRegistry and the map to store metrics. The introduction of the Prometheus Java client dependency is justified and necessary for integrating with Prometheus.


84-120: Implementation looks solid!

The registerOrUpdateCounterSample(...) and registerOrUpdateGaugeSample(...) methods are implemented correctly. The logic for registering and updating counters and gauges follows the best practices of checking for the existence of a metric before creating a new one. The code is readable and well-structured.


125-136: Response method looks good!

The response() method is implemented correctly and follows the expected format for Prometheus. The use of StringWriter is appropriate for writing the metrics, and the error handling is adequate, logging an error message if the write operation fails.

docs/en/extension/java-client-how-to-use-custom-monitor-system.md (1)

1-141: Excellent documentation for creating a custom metrics exporter!

The documentation provides clear step-by-step instructions on how to create a custom metrics exporter for the Apollo Java client to integrate with Prometheus. The code examples are well-structured and cover key aspects such as initialization, metrics registration, and response generation.

This will greatly help users extend the Apollo Java client for monitoring purposes. Great work!

Tools
Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)

docs/zh/client/java-sdk-user-guide.md (6)

402-402: LGTM!

The section heading is clear and describes the content that follows.


404-406: LGTM!

The statement provides useful information about the new observability features in version 2.4.0.


407-408: LGTM!

The statement provides clear instructions on how to enable the monitor feature.


409-410: LGTM!

The statement provides clear instructions on how to enable JMX exposure of monitor data.


413-414: LGTM!

The statement provides clear information about the configuration option and its default value.


417-418: LGTM!

The statement provides a reference to where more information about using the feature can be found.

docs/en/client/java-sdk-user-guide.md (6)

417-435: Excellent addition of monitor-related configurations!

The new configuration options significantly enhance the observability of the Apollo client. The defaults are sensible, and the options provide flexibility to customize the monitoring behavior as needed.

Tools
LanguageTool

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~430-~430: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~434-~434: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)


544-602: Great usage examples for the monitor feature!

The instructions are clear and easy to follow. The configuration examples cover common monitoring scenarios, and the code snippets provide a helpful reference for integrating the feature into a Spring application.

Tools
Markdownlint

573-573: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


686-702: Informative examples of using the ConfigMonitor API!

The code segment provides clear examples of how to manually retrieve various types of monitoring data using the ConfigMonitor API. This is helpful for users who need to process and report data to their monitoring systems.


704-729: Comprehensive metrics data table!

The metrics data table provides a good overview of the key metrics exported by the Apollo client. The metrics cover important aspects like configuration usage, thread pool performance, and exceptions. The naming convention for metrics and tags is consistent and descriptive.


1498-1507: Flexible MetricsExporter extension mechanism!

The MetricsExporter extension provides a powerful way for users to integrate Apollo client metrics with their preferred monitoring systems. The SPI and abstract class offer flexibility and simplify the implementation of custom exporters. This extension aligns well with the enhanced observability features in version 2.4.0.


422-422: Skipping static analysis hints.

The flagged punctuation marks are used appropriately in the configuration keys. Specifying a language for the code block and adding alternate text for images would be nice enhancements but are not critical in this context.

Also applies to: 424-424, 428-428, 430-430, 434-434, 604-604, 573-573, 684-684

Tools
LanguageTool

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)

Comment on lines 411 to 412
![](https://cdn.jsdelivr.net/gh/Rawven/image@main/2024-08-24-14-59-01-image.png)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alternate text to the image.

Images should have alternate text for accessibility.

Add meaningful alternate text within the [] in the image markdown. For example:

![Meaningful alt text describing the image](https://cdn.jsdelivr.net/gh/Rawven/image@main/2024-08-24-14-59-01-image.png) 
Tools
Markdownlint

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

Tools
Markdownlint

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

@nobodyiam nobodyiam added this to the 2.4.0 milestone Oct 6, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (21)
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (4)

44-69: LGTM: Clear explanation and proper initialization in doInit().

The explanation of the doInit() method is clear, and the implementation correctly initializes the Prometheus CollectorRegistry and a map for storing metrics.

Consider adding a brief comment above the doInit() method to explain its purpose, like this:

/**
 * Initializes Prometheus-specific objects for metric collection.
 */
@Override
public void doInit() {
    registry = new CollectorRegistry();
    map = new HashMap<>();
}

71-80: LGTM: Clear explanation and correct implementation of isSupport().

The explanation of the isSupport() method is clear, and the implementation correctly checks if the exporter supports the "prometheus" form.

For improved clarity and maintainability, consider defining a constant for the "prometheus" string:

private static final String PROMETHEUS_FORM = "prometheus";

@Override
public boolean isSupport(String form) {
    return PROMETHEUS_FORM.equals(form);
}

This makes it easier to update the supported form in the future if needed.


82-121: LGTM: Correct implementation of Counter and Gauge metric handling.

The registerOrUpdateCounterSample() and registerOrUpdateGaugeSample() methods are implemented correctly, handling both new and existing metrics appropriately. The code follows Prometheus Java client conventions.

For consistency, consider using the same pattern for both Counter and Gauge creation methods:

private Counter createCounter(String name, Map<String, String> tags) {
    return Counter.build()
        .name(name)
        .help("Apollo metric: " + name)  // Add more descriptive help text
        .labelNames(tags.keySet().toArray(new String[0]))
        .register(registry);
}

private Gauge createGauge(String name, Map<String, String> tags) {
    return Gauge.build()
        .name(name)
        .help("Apollo metric: " + name)  // Add more descriptive help text
        .labelNames(tags.keySet().toArray(new String[0]))
        .register(registry);
}

This change adds more descriptive help text for each metric, which can be useful for users of the monitoring system.


123-141: LGTM: Correct implementation of response() method and helpful conclusion.

The response() method is implemented correctly, properly handling the export of metrics in Prometheus format and managing potential IOExceptions. The conclusion and link to the full code are helpful for users who want to see the complete implementation.

To address the Markdownlint warning and improve the link's appearance, consider formatting the URL as a proper Markdown link:

完整代码:[PrometheusApolloClientMetricsExporter.java](https://github.com/apolloconfig/apollo-java/main/master/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java)

This change will make the link more readable and comply with Markdown best practices.

🧰 Tools
🪛 Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)

docs/en/extension/java-client-how-to-use-custom-monitor-system.md (4)

9-42: Consider adding comments for empty method bodies.

The class structure is well-defined. However, to improve readability and avoid confusion, consider adding comments in the empty method bodies to indicate that implementations will be provided later in the document.

For example:

@Override
public void doInit() {
    // Implementation provided later in the document
}

58-69: Consider explaining the purpose of the cache map.

The Prometheus-specific initialization is well-explained, and the code snippet is clear. However, it would be helpful to briefly explain the purpose of the cache map (map). This would provide readers with a better understanding of its role in the metrics collection process.

For example, you could add:

// map is used to cache metric collectors for efficient lookup and updates
private Map<String, Collector.Describable> map;

71-80: Add a note about the PROMETHEUS constant.

The explanation of the isSupport method is clear, and the code snippet effectively demonstrates its implementation. However, the PROMETHEUS constant used in the isSupport method is not defined in the visible context.

Consider adding a note to explain where this constant is defined, or include its definition in the code snippet. For example:

private static final String PROMETHEUS = "prometheus";

@Override
public boolean isSupport(String form) {
    return PROMETHEUS.equals(form);
}

This will provide readers with a complete understanding of the method's implementation.


123-141: LGTM: Clear implementation of the response method. Fix the link format.

The explanation and implementation of the response method are clear and effective. The method correctly exports data in the Prometheus format and handles potential IOExceptions.

However, the link to the full code at the end of the document is not properly formatted as a Markdown link. To fix this, replace:

Full code:[code](https://github.com/apolloconfig/apollo-java/main/master/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java)

with:

[Full code](https://github.com/apolloconfig/apollo-java/main/master/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java)

This will create a proper Markdown link and improve the document's formatting.

docs/zh/client/java-sdk-user-guide.md (7)

413-420: Consider clarifying the external monitoring configuration option

The apollo.client.monitor.external.type configuration is a good addition for supporting different monitoring systems. However, the name might not be immediately clear to all users. Consider renaming it to something more descriptive, such as apollo.client.monitor.exporter.type or apollo.client.monitor.metrics.exporter.

Also, it would be helpful to provide a list of built-in exporter types (e.g., "prometheus") in the documentation.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


514-581: Excellent addition of Monitor functionality

The introduction of the Monitor functionality in version 2.4.0 is a significant enhancement to the Apollo client's observability. The examples provided for using the Monitor API, configuring JMX exposure, and integrating with Prometheus are clear and helpful.

One suggestion for improvement:
Consider adding a brief explanation of the benefits of using this monitoring feature, such as easier troubleshooting, performance optimization, or integration with existing monitoring systems. This would help users understand the value of implementing these new features.

🧰 Tools
🪛 Markdownlint

542-542: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


582-658: Comprehensive Prometheus metrics example

The provided Prometheus metrics example is excellent, offering a wide range of metrics that cover various aspects of the Apollo client's performance and usage. This will be very useful for users integrating Apollo with their Prometheus monitoring setup.

To improve the documentation:

  1. Add a language specifier to the code block for proper syntax highlighting. For Prometheus metrics, you can use "promql" or "prometheus":
# TYPE apollo_client_thread_pool_queue_remaining_capacity gauge
# HELP apollo_client_thread_pool_queue_remaining_capacity apollo gauge metrics
apollo_client_thread_pool_queue_remaining_capacity{thread_pool_name="RemoteConfigRepository"} 2.147483647E9
...
  1. Consider adding a brief explanation of some key metrics and what they represent, to help users understand which metrics are most important to monitor.
🧰 Tools
🪛 Markdownlint

582-582: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


659-713: Well-organized metrics tables and introduction of SPI extensions

The metrics data tables provide a clear and concise overview of the available metrics, which is very helpful for users. The introduction of SPI extensions for ConfigService load balancing and MetricsExporter adds valuable customization options for advanced users.

Suggestions for improvement:

  1. For the ConfigService load balancing SPI, consider adding a brief example of how to implement a custom load balancing strategy.
  2. For the MetricsExporter SPI, provide a short code snippet demonstrating how to create a custom exporter.
  3. Add links to more detailed documentation or examples for implementing these SPI extensions, if available.

These additions would make it easier for users to understand and implement custom extensions.

🧰 Tools
🪛 Markdownlint

662-662: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


411-411: Add alt text to the image

To improve accessibility and comply with Markdown best practices, please add alternative text to the image. You can do this by modifying the Markdown as follows:

![JProfiler showing Apollo client metrics](https://raw.githubusercontent.com/Rawven/image/main/20240828003803.png)

Replace "JProfiler showing Apollo client metrics" with a brief, descriptive text that explains what the image shows.

🧰 Tools
🪛 Markdownlint

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


415-415: Correct the Chinese grammar

In the Chinese text, there's a minor grammatical issue. The correct form for modifying a verb with an adverb is "adverb + 地 + verb". Please change:

这种设计是为了用户能更方便的扩展。

to:

这种设计是为了用户能更方便地扩展。

This small change will improve the grammatical correctness of the sentence.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


582-582: Specify language for the code block

To improve the formatting and enable syntax highlighting, please specify a language for the fenced code block. For Prometheus metrics, you can use "promql" or "prometheus". Modify the opening of the code block as follows:

```promql

This will enhance the readability of the metrics example.

🧰 Tools
🪛 Markdownlint

582-582: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/en/client/java-sdk-user-guide.md (6)

417-436: Excellent addition of monitoring configuration options!

This new section on Monitor-related Configuration is a valuable addition for users of Apollo client version 2.4.0 and above. It introduces several useful configuration options to enhance observability. Here are some suggestions for minor improvements:

  1. Consider using consistent formatting for configuration keys. You could enclose them in backticks (`) for better readability.
  2. The explanation for apollo.client.monitor.external.type mentions "official or custom implementations". It might be helpful to provide a link or reference to where users can find more information about these implementations.

Overall, this is a great addition to the documentation.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~430-~430: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~434-~434: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)


Line range hint 438-446: Consider updating the Apollo client version

The Maven dependency section is helpful for users integrating Apollo client into their projects. However, the specified version (1.7.0) seems outdated, especially considering the new features mentioned for version 2.4.0 earlier in the document.

Consider updating the version number to the latest stable release that includes the new monitoring features. For example:

<dependency>
    <groupId>com.ctrip.framework.apollo</groupId>
    <artifactId>apollo-client</artifactId>
    <version>2.4.0</version>
</dependency>

This will ensure users have access to the latest features and improvements.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~430-~430: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~434-~434: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)


544-744: Excellent documentation of new monitoring features

This new section on Using the Monitor Feature is a great addition to the documentation. It clearly explains how to enable and use the new monitoring capabilities introduced in version 2.4.0, including JMX and Prometheus integration. The code snippets, configuration examples, and metrics data table are particularly helpful for users implementing these features.

One minor suggestion for improvement:

Consider using language-specific code block formatting for better syntax highlighting. For example, replace:

apollo:
  client:
    monitor:
      enabled: true

with:

apollo:
  client:
    monitor:
      enabled: true

This will enable YAML syntax highlighting for better readability.

🧰 Tools
🪛 Markdownlint

614-614: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


573-573: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


694-694: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


1506-1518: Valuable information on apollo-client customization

This section on apollo-client customization provides useful information for advanced users who need to tailor the client's behavior to their specific requirements. The explanations of the ConfigService load balancing algorithm and MetricsExporter extension are clear and informative.

To further enhance this section, consider adding brief code examples for each customization option. For instance:

  1. For the ConfigService load balancing algorithm:
public class CustomConfigServiceLoadBalancer implements ConfigServiceLoadBalancerClient {
    @Override
    public ServiceDTO getConfigService(List<ServiceDTO> configServices) {
        // Custom implementation
    }
}
  1. For the MetricsExporter extension:
public class CustomMetricsExporter extends AbstractApolloClientMetricsExporter {
    @Override
    protected void doExport() {
        // Custom implementation
    }
}

These examples would give users a starting point for implementing their own customizations.


Line range hint 1520-1612: Address relevant static analysis suggestions

The static analysis tools have flagged some issues, most of which are minor or potentially false positives. However, there are a couple of suggestions worth considering:

  1. Code block language specification: For better syntax highlighting and readability, consider specifying the language for fenced code blocks. For example, use yaml for YAML configurations and java for Java code snippets.

  2. Image alt text: Add alternative text to images for improved accessibility. For example:

    ![JProfiler monitoring view](https://raw.githubusercontent.com/Rawven/image/main/20240828003803.png)

Implementing these suggestions will improve the overall quality and accessibility of the documentation.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~430-~430: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~434-~434: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)


Line range hint 1-1612: Excellent comprehensive documentation with valuable updates

This document provides a thorough and well-structured guide to using the Apollo client, covering everything from basic setup to advanced customization options. The recent additions, particularly the sections on monitoring features introduced in version 2.4.0, significantly enhance the value of this documentation for users.

Overall, the content is of high quality and will be very helpful for developers working with Apollo. To further improve the document, consider the following minor suggestions:

  1. Ensure consistency in version numbers throughout the document. Some sections mention version 2.4.0, while others (like the Maven dependency) use older versions.
  2. Standardize the formatting of configuration keys and code snippets, using consistent syntax highlighting and backticks where appropriate.
  3. Review and update any links to external resources to ensure they are current and functional.

These small improvements will help maintain the high quality of this already excellent documentation.

🧰 Tools
🪛 Markdownlint

614-614: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


573-573: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


694-694: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 254c449 and 2a595bb.

📒 Files selected for processing (4)
  • docs/en/client/java-sdk-user-guide.md (4 hunks)
  • docs/en/extension/java-client-how-to-use-custom-monitor-system.md (1 hunks)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
  • docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/en/client/java-sdk-user-guide.md

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~430-~430: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~434-~434: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)

docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~415-~415: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

🪛 Markdownlint
docs/en/client/java-sdk-user-guide.md

614-614: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


573-573: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


694-694: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/client/java-sdk-user-guide.md

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


582-582: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


542-542: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


662-662: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/extension/java-client-how-to-use-custom-monitor-system.md

141-141: null
Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (7)
docs/zh/extension/java-client-how-to-use-custom-monitor-system.md (2)

1-13: LGTM: Clear introduction and proper class definition.

The introduction clearly states the purpose of the new feature, and the class definition for PrometheusApolloClientMetricsExporter is correctly structured, extending AbstractApolloClientMetricsExporter and implementing ApolloClientMetricsExporter.


1-141: Excellent documentation for custom monitoring implementation.

This document provides a comprehensive and well-structured guide for implementing a custom monitoring system, specifically a Prometheus-based metrics exporter, for the Apollo Java client. The explanations are clear, and the code snippets are correct and illustrative.

Key strengths of this documentation:

  1. Clear introduction and purpose statement
  2. Step-by-step explanation of each method's implementation
  3. Proper code snippets with explanations
  4. Helpful conclusion with a link to the full code

The minor suggestions provided in the review comments will further enhance the clarity, consistency, and adherence to best practices. Overall, this documentation will be very useful for users looking to implement custom monitoring for their Apollo Java client.

🧰 Tools
🪛 Markdownlint

141-141: null
Bare URL used

(MD034, no-bare-urls)

docs/en/extension/java-client-how-to-use-custom-monitor-system.md (3)

1-8: LGTM: Clear introduction and example setup.

The introduction effectively sets the context for the new feature in version 2.4.0 and above. The Prometheus integration example is a good choice for demonstrating the implementation.


44-56: LGTM: Clear explanation of doInit method.

The explanation of the doInit method and its usage in AbstractApolloClientMetricsExporter is clear and concise. The provided code snippet effectively demonstrates how doInit is called within the init method.


82-121: LGTM: Comprehensive implementation of metric registration methods.

The explanations and implementations of registerOrUpdateCounterSample and registerOrUpdateGaugeSample methods are clear and comprehensive. The code snippets effectively demonstrate how to register and update Counter and Gauge metrics, including the creation of new metrics when they don't exist in the cache.

docs/zh/client/java-sdk-user-guide.md (1)

401-412: New monitoring features introduced

These new configuration options for Apollo client monitoring in version 2.4.0+ significantly enhance the client's observability. They allow users to enable monitoring, expose data via JMX, and control exception queue size. This is a valuable addition for users who need better insights into their Apollo client's behavior.

🧰 Tools
🪛 Markdownlint

411-411: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/en/client/java-sdk-user-guide.md (1)

Line range hint 448-473: Comprehensive overview of client usage approaches

This section provides an excellent overview of the different ways to use Apollo client. The comparison between the API approach and Spring integration approach is particularly helpful for users to choose the most suitable method for their needs. The mention of Spring Boot integration and the reference to additional usage scenarios and sample code are valuable additions.

The information in this section is well-organized and comprehensive, offering users a clear understanding of their options when using Apollo client.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
docs/zh/client/java-sdk-user-guide.md (4)

401-417: Consider adding a brief introduction to the monitoring feature

The new section about monitoring configurations is informative. However, it would be helpful to add a brief introduction explaining the purpose and benefits of the monitoring feature before diving into the specific configurations. This will provide context for users and help them understand why they might want to use these settings.

Additionally, consider using consistent formatting for configuration keys. For example, you could use backticks (`) to highlight the configuration keys throughout the section.

Here's a suggested improvement for the beginning of this section:

#### 1.2.4.9 Monitor相关配置

> 适用于2.4.0及以上版本

Apollo客户端在2.4.0版本中引入了增强的监控功能,允许用户更好地观察和管理客户端的状态。以下是相关的配置选项:

- `apollo.client.monitor.enabled`:是否启动Monitor机制,即ConfigMonitor是否启用,默认为false
- `apollo.client.monitor.jmx.enabled`:是否将Monitor数据以JMX形式暴露,开启后可以通过JConsole、JProfiler等工具查看相关信息,默认为false
...
🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


512-680: Improve formatting and clarity in the metrics exporting section

The metrics exporting section provides valuable information, but there are some areas where formatting and clarity can be improved:

  1. Use consistent formatting for code blocks. Specify the language for each code block to enable syntax highlighting. For example:
```yaml
apollo:
  client:
    monitor:
      enabled: true

2. Add meaningful alt text to images for better accessibility. For example:

```markdown
![JProfiler showing Apollo metrics](https://raw.githubusercontent.com/Rawven/image/main/20241020224657.png)
  1. Consider breaking down the long Prometheus metrics example into smaller, more digestible sections with explanations for each metric type.

  2. Improve the language in some parts for better clarity. For example, change "这样就可以通过ConfigMonitor拿到ExporterData(格式取决于你配置的监控系统),然后暴露端点给Prometheus即可" to "通过这种方式,您可以使用ConfigMonitor获取ExporterData(其格式取决于您配置的监控系统),然后将端点暴露给Prometheus进行监控。"

These improvements will enhance the readability and usability of the documentation.

🧰 Tools
🪛 Markdownlint

580-580: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


540-540: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


660-660: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


413-413: Correct grammar for better readability

On line 413, there's a minor grammatical issue. The correct form should use "地" instead of "的" when modifying a verb. Please change:

- 这种设计是为了用户能更方便的扩展。
+ 这种设计是为了用户能更方便地扩展。

This small change improves the grammatical correctness of the sentence.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


511-512: Add a transition between monitoring configuration and metrics exporting sections

To improve the flow of the document, consider adding a brief transition between the monitoring configuration section and the metrics exporting section. This will help readers understand the relationship between these two features. For example:

...

现在我们已经了解了如何配置监控功能,接下来让我们看看如何使用这些监控功能并导出指标数据。

### 3.1.5 使用Monitor功能

Apollo客户端在2.4.0版本里大幅增强了可观测性,提供了ConfigMonitor-API以及JMX、Prometheus的指标导出方式。

This transition helps to connect the configuration section with the usage section, providing a smoother reading experience.

docs/en/client/java-sdk-user-guide.md (3)

417-434: Excellent addition of monitoring configurations!

The new monitor-related configurations for Apollo Client version 2.4.0+ are well-documented and provide valuable options for enhancing observability. Each configuration is clearly explained with its purpose and default value.

Consider adding a brief example of how to enable these configurations in a typical setup to make it even more user-friendly.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~426-~426: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~432-~432: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)


542-611: Clear instructions for using the Monitor feature

The instructions for enabling and using the Monitor feature are well-explained and easy to follow. The inclusion of code examples is particularly helpful.

The YAML code block at lines 549-554 is missing a language specifier. Consider adding yaml after the opening fence for better syntax highlighting:

-```
+```yaml
 apollo:
   client:
     monitor:
       enabled: true
🧰 Tools
🪛 Markdownlint

571-571: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


612-691: Comprehensive guide for Prometheus integration

The instructions for exporting metrics via Prometheus are thorough and well-structured. The inclusion of dependency information and configuration steps is very helpful.

The image at line 571 is missing alternative text. Consider adding a descriptive alt text to improve accessibility, for example:

![J-profiler screenshot showing Apollo metrics](https://raw.githubusercontent.com/Rawven/image/main/20241020224657.png)
🧰 Tools
🪛 Markdownlint

612-612: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2a595bb and 1b72421.

📒 Files selected for processing (2)
  • docs/en/client/java-sdk-user-guide.md (4 hunks)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/en/client/java-sdk-user-guide.md

[uncategorized] ~422-~422: Loose punctuation mark.
Context: ...ations. apollo.client.monitor.enabled: Enables the Monitor mechanism, i.e., wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~424-~424: Loose punctuation mark.
Context: ...se. apollo.client.monitor.jmx.enabled: Exposes Monitor data in JMX format. If ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~426-~426: Loose punctuation mark.
Context: ...llo.client.monitor.exception-queue-size`: Sets the maximum number of exceptions t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~428-~428: Loose punctuation mark.
Context: .... apollo.client.monitor.external.type: Non-standard configuration item, us...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~432-~432: Loose punctuation mark.
Context: ...o.client.monitor.external.export-period`: The Exporter exports status information...

(UNLIKELY_OPENING_PUNCTUATION)

docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

🪛 Markdownlint
docs/en/client/java-sdk-user-guide.md

612-612: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


571-571: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


692-692: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/client/java-sdk-user-guide.md

580-580: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


540-540: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


660-660: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

🔇 Additional comments (4)
docs/zh/client/java-sdk-user-guide.md (1)

Line range hint 401-680: Overall improvement in documentation with new monitoring features

The additions to the Apollo Java SDK user guide, particularly the sections on monitoring configuration and metrics exporting, significantly enhance the documentation. These new features provide users with powerful tools for observing and managing their Apollo client's behavior.

The content is generally well-structured and informative. With the suggested improvements in formatting, language, and transitions, the documentation will be even more user-friendly and accessible.

Key points to address:

  1. Add brief introductions to new sections for context.
  2. Improve formatting consistency, especially in code blocks.
  3. Add alt text to images for accessibility.
  4. Make minor language and grammar improvements.
  5. Enhance transitions between sections.

These changes will result in a more polished and professional documentation that better serves Apollo users.

🧰 Tools
🪛 Markdownlint

580-580: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


540-540: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


660-660: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/en/client/java-sdk-user-guide.md (3)

694-710: Well-documented ConfigMonitor API usage examples

The examples provided for manually calling the ConfigMonitor API are clear and cover various aspects of monitoring data retrieval. The comments preceding each example help in understanding the purpose of each API call.


712-742: Comprehensive metrics data tables

The provided metrics data tables for Namespace and Thread Pool metrics are well-organized and offer a clear overview of available metrics. This information will be valuable for users setting up monitoring systems.


738-742: Clear exception metrics table

The exception metrics table is concise and provides clear information about the available exception-related metric. This complements the previous metrics tables well.

docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
Co-authored-by: wxq <Anilople@outlook.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

401-418: Fix grammatical issue and improve formatting

  1. Line 413: "方便的扩展" should be "方便地扩展" according to Chinese grammar rules
  2. Consider adding a table to better organize the configuration properties and their descriptions
-这种设计是为了用户能更方便的扩展
+这种设计是为了用户能更方便地扩展
🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1b72421 and 9bcc0f2.

📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

580-580: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


540-540: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


660-660: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
@Rawven Rawven force-pushed the docs/observability branch 2 times, most recently from 790b9d6 to ce00c5c Compare October 23, 2024 14:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (3)
docs/zh/client/java-sdk-user-guide.md (2)

401-418: Improve configuration documentation formatting.

Consider enhancing the readability of the configuration section by:

  • Using a table format to present the configuration properties
  • Adding example values for each property
  • Including default values in the description

Example table format:

| Property | Default | Description |
|----------|---------|-------------|
| apollo.client.monitor.enabled | false | Whether to enable Monitor mechanism |
| apollo.client.monitor.jmx.enabled | false | Whether to expose Monitor data via JMX |
| apollo.client.monitor.exception-queue-size | 25 | Maximum number of exceptions to store |
| apollo.client.monitor.external.type | - | Type of metrics exporter to enable |
| apollo.client.monitor.external.export-period | 10 | Export period in seconds |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


553-582: Enhance metrics documentation with descriptions.

The metrics tables would be more helpful with detailed descriptions for each metric, including:

  • What the metric measures
  • Units of measurement
  • Common troubleshooting scenarios
  • Recommended thresholds if applicable

For example:

## Namespace Metrics
| Metric Name | Labels | Description | Unit |
|-------------|--------|-------------|------|
| apollo_client_namespace_usage_total | namespace | Total number of times a namespace has been accessed | count |
| apollo_client_namespace_item_num | namespace | Number of configuration items in a namespace | count |
docs/en/client/java-sdk-user-guide.md (1)

Line range hint 1284-1285: Enhance the load balancer documentation section.

While the documentation introduces the ConfigService load balancer feature, it could be improved by:

  1. Adding code examples showing how to implement a custom load balancer
  2. Including configuration steps to enable a custom implementation
  3. Explaining the SPI registration process
  4. Documenting the method(s) that need to be implemented
  5. Adding best practices and considerations when implementing a custom load balancer

Consider adding the following template for implementing a custom load balancer:

public class CustomConfigServiceLoadBalancer implements ConfigServiceLoadBalancerClient {
    @Override
    public ServiceDTO select(List<ServiceDTO> configServices) {
        // Custom load balancing logic here
        return configServices.get(0); // Example implementation
    }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between da51124 and ce00c5c.

⛔ Files ignored due to path filters (2)
  • doc/images/apollo-client-monitor-jmx.png is excluded by !**/*.png
  • doc/images/apollo-client-monitor-prometheus.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • docs/en/client/java-sdk-user-guide.md (1 hunks)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


[uncategorized] ~1514-~1514: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

583-583: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time

(MD001, heading-increment)


1573-1573: null
Bare URL used

(MD034, no-bare-urls)


1353-1353: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Comment on lines 1323 to 1330
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-plugin-client-prometheus</artifactId>
<version>2.4.0-SNAPSHOT</version>
</dependency>
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable and may not be available to all users.

Apply this diff:

      <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-plugin-client-prometheus</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0</version>
      </dependency>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-plugin-client-prometheus</artifactId>
<version>2.4.0-SNAPSHOT</version>
</dependency>
```
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-plugin-client-prometheus</artifactId>
<version>2.4.0</version>
</dependency>

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (5)
docs/zh/client/java-sdk-user-guide.md (5)

401-418: Enhance the configuration documentation with examples.

Consider adding example values and use cases for each configuration property to make it clearer for users. For example:

# Enable monitoring
apollo.client.monitor.enabled=true

# Enable JMX metrics exposure
apollo.client.monitor.jmx.enabled=true 

# Set exception queue size to 50
apollo.client.monitor.exception-queue-size=50

# Enable Prometheus metrics export
apollo.client.monitor.external.type=prometheus

# Set metrics export period to 30 seconds
apollo.client.monitor.external.export-period=30
🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


530-530: Add descriptive alt text to the JMX metrics image.

The image showing JMX metrics should have descriptive alt text for accessibility:

-![](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.png)
+![JProfiler showing Apollo client monitoring metrics exposed via JMX](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.png)

535-549: Add comments to explain the ConfigMonitor API usage.

The code example would be more helpful with explanatory comments:

// Get the ConfigMonitor instance
ConfigMonitor configMonitor = ConfigService.getConfigMonitor(); 

// Get API for monitoring exceptions
ApolloClientExceptionMonitorApi exceptionMonitorApi = configMonitor.getExceptionMonitorApi(); 
List<Exception> apolloConfigExceptionList = exceptionMonitorApi.getApolloConfigExceptionList();

// Get API for monitoring namespaces
ApolloClientNamespaceMonitorApi namespaceMonitorApi = configMonitor.getNamespaceMonitorApi(); 
List<String> namespace404 = namespaceMonitorApi.getNotFoundNamespaces();

// Get API for monitoring bootstrap arguments
ApolloClientBootstrapArgsMonitorApi runningParamsMonitorApi = configMonitor.getRunningParamsMonitorApi(); 
String bootstrapNamespaces = runningParamsMonitorApi.getBootstrapNamespaces();

// Get API for monitoring thread pools
ApolloClientThreadPoolMonitorApi threadPoolMonitorApi = configMonitor.getThreadPoolMonitorApi(); 
ApolloThreadPoolInfo remoteConfigRepositoryThreadPoolInfo = threadPoolMonitorApi.getRemoteConfigRepositoryThreadPoolInfo();

553-582: Enhance metrics documentation with descriptions.

Consider adding descriptions for each metric to help users understand what they measure and when to use them. For example:

## Namespace Metrics

| Metric Name | Labels | Description |
|------------|---------|-------------|
| apollo_client_namespace_usage_total | namespace | Total number of times a namespace has been accessed |
| apollo_client_namespace_item_num | namespace | Number of configuration items in a namespace |
...

1435-1435: Add descriptive alt text to the Prometheus metrics image.

The image showing Prometheus metrics should have descriptive alt text for accessibility:

-![](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-prometheus.png)
+![Prometheus console showing Apollo client metrics with various gauges and counters](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-prometheus.png)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ce00c5c and 33d40cb.

⛔ Files ignored due to path filters (2)
  • doc/images/apollo-client-monitor-jmx.png is excluded by !**/*.png
  • doc/images/apollo-client-monitor-prometheus.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • docs/en/client/java-sdk-user-guide.md (1 hunks)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/en/client/java-sdk-user-guide.md
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


[uncategorized] ~1516-~1516: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

583-583: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time

(MD001, heading-increment)


515-515: null
Link fragments should be valid

(MD051, link-fragments)


584-584: null
Link fragments should be valid

(MD051, link-fragments)


1575-1575: null
Bare URL used

(MD034, no-bare-urls)


1355-1355: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

1325-1330: ⚠️ Potential issue

Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable. Use a stable version instead:

      <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-plugin-client-prometheus</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0</version>
      </dependency>

Likely invalid or redundant comment.

docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
Rawven and others added 2 commits October 23, 2024 23:21
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Rawven
Copy link
Author

Rawven commented Oct 23, 2024

Have fix it all,PTAL @Anilople

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
docs/en/client/java-sdk-user-guide.md (1)

1284-1284: LGTM! Consider adding implementation example.

The documentation clearly explains the default load balancer implementation. To make it even more helpful, consider adding a simple code example showing how to implement a custom load balancer using the SPI interface.

Example addition could look like:

public class RoundRobinConfigServiceLoadBalancerClient implements ConfigServiceLoadBalancerClient {
    private AtomicInteger index = new AtomicInteger(0);
    
    @Override
    public ServiceDTO select(List<ServiceDTO> services) {
        if (services == null || services.isEmpty()) {
            return null;
        }
        return services.get(Math.abs(index.getAndIncrement() % services.size()));
    }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 33d40cb and 4d70e3b.

⛔ Files ignored due to path filters (2)
  • doc/images/apollo-client-monitor-jmx.png is excluded by !**/*.png
  • doc/images/apollo-client-monitor-prometheus.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • docs/en/client/java-sdk-user-guide.md (1 hunks)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


[uncategorized] ~1517-~1517: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

552-552: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


562-562: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


576-576: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


515-515: null
Link fragments should be valid

(MD051, link-fragments)


584-584: null
Link fragments should be valid

(MD051, link-fragments)


1355-1355: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (4)
docs/zh/client/java-sdk-user-guide.md (4)

401-418: LGTM! Well-documented monitoring configuration section.

The new section clearly documents the client monitoring configuration properties, including their purposes and default values.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


512-548: LGTM! Clear API documentation with examples.

The section effectively demonstrates how to access monitoring metrics through the ConfigMonitor API.

🧰 Tools
🪛 Markdownlint

515-515: null
Link fragments should be valid

(MD051, link-fragments)


550-575: LGTM! Well-structured metrics documentation.

The metrics tables provide a clear overview of available metrics and their labels.

🧰 Tools
🪛 Markdownlint

552-552: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


562-562: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1322-1435: ⚠️ Potential issue

Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable and may not be available to all users.

Apply this diff:

      <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-plugin-client-prometheus</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0</version>
      </dependency>

Likely invalid or redundant comment.

🧰 Tools
🪛 Markdownlint

1355-1355: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
@Rawven
Copy link
Author

Rawven commented Oct 23, 2024

The test case is unstable and may fail. In theory, my modifications will not affect the test run.@nobodyiam

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
docs/zh/client/java-sdk-user-guide.md (3)

407-418: Consider improving the configuration properties format.

The configuration properties section would be more readable if formatted consistently using a properties block. Also, the description of apollo.client.monitor.external.type could be clearer.

Consider restructuring like this:

# Enable Monitor mechanism (ConfigMonitor)
apollo.client.monitor.enabled=false

# Expose Monitor data via JMX
apollo.client.monitor.jmx.enabled=false

# Maximum number of exceptions stored in Monitor
apollo.client.monitor.exception-queue-size=25

# Type of metrics exporter (e.g. prometheus)
apollo.client.monitor.external.type=

# Export period for metrics collection (in seconds)
apollo.client.monitor.external.export-period=10
🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


533-547: Enhance the API usage example with error handling.

The code example shows basic API usage but lacks error handling and resource cleanup.

Consider enhancing the example:

try {
    ConfigMonitor configMonitor = ConfigService.getConfigMonitor();
    
    // Error monitoring API
    ApolloClientExceptionMonitorApi exceptionMonitorApi = configMonitor.getExceptionMonitorApi();
    List<Exception> apolloConfigExceptionList = exceptionMonitorApi.getApolloConfigExceptionList();
    
    // Namespace monitoring API
    ApolloClientNamespaceMonitorApi namespaceMonitorApi = configMonitor.getNamespaceMonitorApi();
    List<String> namespace404 = namespaceMonitorApi.getNotFoundNamespaces();
    
    // Bootstrap args monitoring API
    ApolloClientBootstrapArgsMonitorApi runningParamsMonitorApi = configMonitor.getRunningParamsMonitorApi();
    String bootstrapNamespaces = runningParamsMonitorApi.getBootstrapNamespaces();
    
    // Thread pool monitoring API
    ApolloClientThreadPoolMonitorApi threadPoolMonitorApi = configMonitor.getThreadPoolMonitorApi();
    ApolloThreadPoolInfo remoteConfigRepositoryThreadPoolInfo = threadPoolMonitorApi.getRemoteConfigRepositoryThreadPoolInfo();
} catch (Exception e) {
    logger.error("Failed to collect monitoring metrics", e);
}

551-573: Enhance metrics documentation with additional metadata.

The metrics tables would be more useful with additional columns for metric types and units.

Consider adding columns for:

  • Metric Type (gauge/counter)
  • Unit (milliseconds, count, etc.)
  • Description of when/how the metric changes

Example format:

| Metric Name | Labels | Type | Unit | Description |
|------------|--------|------|------|-------------|
| apollo_client_namespace_usage_total | namespace | Counter | count | Total number of namespace usages |
🧰 Tools
🪛 Markdownlint

551-551: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


561-561: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4d70e3b and 30bc464.

📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


[uncategorized] ~1516-~1516: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

551-551: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


561-561: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


575-575: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


514-514: null
Link fragments should be valid

(MD051, link-fragments)


583-583: null
Link fragments should be valid

(MD051, link-fragments)


1354-1354: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (2)
docs/zh/client/java-sdk-user-guide.md (2)

1574-1575: ⚠️ Potential issue

Fix the link format at the end of the file.

The link should be properly formatted as a markdown link.

Apply this diff:

-完整代码:[PrometheusApolloClientMetricsExporter.java]https://github.com/apolloconfig/apollo-java/main/master/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java
+完整代码:[PrometheusApolloClientMetricsExporter.java](https://github.com/apolloconfig/apollo-java/blob/main/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java)

Likely invalid or redundant comment.


1322-1329: ⚠️ Potential issue

Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable and may not be available to all users.

Apply this diff:

      <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-plugin-client-prometheus</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0</version>
      </dependency>

Likely invalid or redundant comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
docs/zh/client/java-sdk-user-guide.md (3)

401-418: Enhance the configuration documentation.

Consider the following improvements to make the configuration section more user-friendly:

  1. Add a table summarizing all configuration properties with their default values and descriptions
  2. Include examples showing different configuration combinations
  3. Add a note about performance implications of enabling monitoring

Example table format:

| Property | Default | Description |
|----------|---------|-------------|
| apollo.client.monitor.enabled | false | Enables/disables Monitor mechanism |
| apollo.client.monitor.jmx.enabled | false | Exposes Monitor data via JMX |
| apollo.client.monitor.exception-queue-size | 25 | Maximum number of stored exceptions |
| apollo.client.monitor.external.type | - | Type of metrics exporter (e.g. prometheus) |
| apollo.client.monitor.external.export-period | 10 | Export period in seconds |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


553-573: Improve table formatting for better readability.

The metrics tables could be better formatted. Consider:

  1. Adding column alignment
  2. Using consistent spacing
  3. Adding units where applicable

Example format for the Thread Pool Metrics table:

| Metric Name | Labels | Description |
|:------------|:-------|:------------|
| apollo_client_thread_pool_pool_size | thread_pool_name | Current pool size |
| apollo_client_thread_pool_maximum_pool_size | thread_pool_name | Maximum allowed pool size |
🧰 Tools
🪛 Markdownlint

561-561: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1443-1476: Improve code example structure.

The implementation example could be better organized. Consider:

  1. Adding comments to explain each method's purpose
  2. Including type information for parameters
  3. Adding error handling examples

Example structure:

/**
 * Prometheus implementation of Apollo Client Metrics Exporter.
 */
public class PrometheusApolloClientMetricsExporter extends AbstractApolloClientMetricsExporter {
    
    /**
     * Initialize Prometheus specific components.
     */
    @Override
    public void doInit() {
        // Implementation
    }

    /**
     * Check if this exporter supports the given format.
     * @param format The metrics format to check
     * @return true if format is "prometheus"
     */
    @Override
    public boolean isSupport(String format) {
        // Implementation
    }
    
    // Other methods...
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 30bc464 and ddfaf0f.

📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


[uncategorized] ~1516-~1516: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

551-551: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


561-561: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


575-575: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


514-514: null
Link fragments should be valid

(MD051, link-fragments)


583-583: null
Link fragments should be valid

(MD051, link-fragments)


1354-1354: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

1574-1575: ⚠️ Potential issue

Fix the code reference link format.

The code reference link at the end of the file is malformed.

Apply this fix:

-完整代码:[PrometheusApolloClientMetricsExporter.java](https://github.com/apolloconfig/apollo-java/main/master/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java)
+完整代码:[PrometheusApolloClientMetricsExporter.java](https://github.com/apolloconfig/apollo-java/blob/main/apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java)

Likely invalid or redundant comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
docs/zh/client/java-sdk-user-guide.md (5)

401-418: Enhance the monitoring configuration documentation.

Consider the following improvements:

  1. Add a table to better organize the configuration properties and their default values
  2. Include examples for each configuration property
  3. Add cross-references to related sections

Here's a suggested format:

#### 1.2.4.9 开启客户端监控

> 适用于2.4.0及以上版本

| 配置项 | 说明 | 默认值 |
|-------|------|--------|
| apollo.client.monitor.enabled | 是否启动Monitor机制 | false |
| apollo.client.monitor.jmx.enabled | 是否将Monitor数据以Jmx形式暴露 | false |
| apollo.client.monitor.exception-queue-size | Monitor存储Exception的最大数量 | 25 |
| apollo.client.monitor.external.type | 用于导出指标数据时启用对应监控系统的Exporter | - |
| apollo.client.monitor.external.export-period | Exporter导出状态信息的频率(秒) | 10 |

示例配置:
```properties
# 启用监控
apollo.client.monitor.enabled=true
# 启用JMX
apollo.client.monitor.jmx.enabled=true
# 设置异常队列大小
apollo.client.monitor.exception-queue-size=50
# 启用Prometheus导出
apollo.client.monitor.external.type=prometheus
# 设置导出频率为30秒
apollo.client.monitor.external.export-period=30

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary><blockquote>

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。  具体使用见 扩展开发-j...

(wb4)

</blockquote></details>

</details>

---

`512-547`: **Improve API usage documentation and code examples.**

The code examples could be enhanced with:
1. Comments explaining each API call
2. Error handling examples
3. Complete class structure


Here's a suggested improvement:

```java
// 获取ConfigMonitor实例
ConfigMonitor configMonitor = ConfigService.getConfigMonitor(); 

try {
    // 1. 错误相关监控API  
    ApolloClientExceptionMonitorApi exceptionMonitorApi = configMonitor.getExceptionMonitorApi(); 
    List<Exception> apolloConfigExceptionList = exceptionMonitorApi.getApolloConfigExceptionList();
    
    // 2. 命名空间相关监控API  
    ApolloClientNamespaceMonitorApi namespaceMonitorApi = configMonitor.getNamespaceMonitorApi(); 
    List<String> namespace404 = namespaceMonitorApi.getNotFoundNamespaces();
    
    // 3. 启动参数相关监控API  
    ApolloClientBootstrapArgsMonitorApi runningParamsMonitorApi = configMonitor.getRunningParamsMonitorApi(); 
    String bootstrapNamespaces = runningParamsMonitorApi.getBootstrapNamespaces();
    
    // 4. 线程池相关监控API  
    ApolloClientThreadPoolMonitorApi threadPoolMonitorApi = configMonitor.getThreadPoolMonitorApi(); 
    ApolloThreadPoolInfo remoteConfigRepositoryThreadPoolInfo = threadPoolMonitorApi.getRemoteConfigRepositoryThreadPoolInfo();
} catch (Exception e) {
    logger.error("Failed to get monitoring metrics", e);
}
🧰 Tools
🪛 Markdownlint

514-514: null
Link fragments should be valid

(MD051, link-fragments)


549-580: Add descriptions and examples for metrics.

Consider enhancing the metrics documentation with:

  1. Description of each metric's purpose
  2. Example values and interpretation
  3. Common use cases

Add descriptions like this for each metric:

**Namespace Metrics**

| 指标名称 | 标签 | 描述 | 示例值 |
|---------|------|------|--------|
| apollo_client_namespace_usage_total | namespace | 命名空间使用计数器 | 100 |
| apollo_client_namespace_item_num | namespace | 命名空间中的配置项数量 | 50 |
| apollo_client_namespace_not_found | - | 未找到的命名空间数量 | 1 |
🧰 Tools
🪛 Markdownlint

551-551: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


561-561: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


575-575: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1339-1350: Enhance the controller example with best practices.

The example should include proper error handling and metrics format specification.

Here's an improved version:

@RestController
@ResponseBody
public class MetricsController {
    private static final Logger logger = LoggerFactory.getLogger(MetricsController.class);

    @GetMapping(value = "/metrics", produces = "text/plain; version=0.0.4; charset=utf-8")
    public ResponseEntity<String> metrics() {
        try {
            ConfigMonitor configMonitor = ConfigService.getConfigMonitor();
            String metrics = configMonitor.getExporterData();
            return ResponseEntity.ok(metrics);
        } catch (Exception e) {
            logger.error("Failed to get metrics", e);
            return ResponseEntity.status(500).body("Error collecting metrics");
        }
    }
}   

1437-1575: Enhance the custom implementation example.

The example could be improved with:

  1. Better error handling in the response() method
  2. Documentation for each method
  3. Configuration examples
  4. Testing guidelines

Add method documentation like this:

/**
 * Prometheus metrics exporter implementation for Apollo client monitoring.
 */
public class PrometheusApolloClientMetricsExporter extends AbstractApolloClientMetricsExporter {
    private static final String PROMETHEUS = "prometheus";
    private static final Logger logger = LoggerFactory.getLogger(PrometheusApolloClientMetricsExporter.class);
    
    /**
     * Initialize the Prometheus registry and metrics cache.
     */
    @Override
    public void doInit() {
        registry = new CollectorRegistry();
        map = new HashMap<>();
    }
    
    // Add similar documentation for other methods...
}
🧰 Tools
🪛 LanguageTool

[uncategorized] ~1516-~1516: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ddfaf0f and f60b1da.

⛔ Files ignored due to path filters (1)
  • doc/images/apollo-client-monitor-jmx.jpg is excluded by !**/*.jpg
📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~413-~413: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 具体使用见 扩展开发-j...

(wb4)


[uncategorized] ~1516-~1516: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

551-551: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


561-561: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


575-575: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


514-514: null
Link fragments should be valid

(MD051, link-fragments)


583-583: null
Link fragments should be valid

(MD051, link-fragments)


1354-1354: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

1321-1329: ⚠️ Potential issue

Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable and may not be available to all users.

Apply this diff:

      <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-plugin-client-prometheus</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0</version>
      </dependency>

Likely invalid or redundant comment.

docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
docs/zh/client/java-sdk-user-guide.md (2)

1381-1388: Add language specification to code block.

The metrics output example should specify the language/format for better rendering and syntax highlighting.

-```
+```prometheus
# TYPE apollo_client_thread_pool_active_task_count gauge
# HELP apollo_client_thread_pool_active_task_count apollo gauge metrics
apollo_client_thread_pool_active_task_count{thread_pool_name="RemoteConfigRepository"} 0.0
apollo_client_thread_pool_active_task_count{thread_pool_name="AbstractApolloClientMetricsExporter"} 1.0
apollo_client_thread_pool_active_task_count{thread_pool_name="AbstractConfigFile"} 0.0
apollo_client_thread_pool_active_task_count{thread_pool_name="AbstractConfig"} 0.0
🧰 Tools
🪛 Markdownlint

1381-1381: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


1526-1609: Replace hard tabs with spaces.

The code examples use hard tabs for indentation. For better consistency and readability across different editors, replace tabs with spaces.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~1552-~1552: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint

1526-1526: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1527-1527: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1528-1528: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1529-1529: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1530-1530: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1532-1532: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1533-1533: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1534-1534: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1535-1535: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1536-1536: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1537-1537: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1538-1538: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1546-1546: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1547-1547: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1548-1548: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1549-1549: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1556-1556: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1557-1557: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1558-1558: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1560-1560: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1561-1561: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1562-1562: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1563-1563: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1565-1565: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1566-1566: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1568-1568: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1569-1569: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1570-1570: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1571-1571: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1572-1572: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1573-1573: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1574-1574: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1577-1577: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1578-1578: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1579-1579: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1580-1580: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1581-1581: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1582-1582: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1583-1583: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1584-1584: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1585-1585: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1587-1587: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1589-1589: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1590-1590: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1591-1591: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1592-1592: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1593-1593: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1594-1594: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1595-1595: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1596-1596: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1597-1597: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1605-1605: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1606-1606: Column: 1
Hard tabs

(MD010, no-hard-tabs)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f60b1da and a07081b.

⛔ Files ignored due to path filters (1)
  • doc/images/apollo-client-monitor-jmx.jpg is excluded by !**/*.jpg
📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~425-~425: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 ```propertie...

(wb4)


[uncategorized] ~1552-~1552: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

572-572: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


574-574: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


586-586: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


602-602: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


572-572: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


572-572: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


534-534: null
Link fragments should be valid

(MD051, link-fragments)


570-570: null
Link fragments should be valid

(MD051, link-fragments)


1526-1526: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1527-1527: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1528-1528: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1529-1529: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1530-1530: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1532-1532: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1533-1533: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1534-1534: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1535-1535: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1536-1536: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1537-1537: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1538-1538: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1546-1546: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1547-1547: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1548-1548: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1549-1549: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1556-1556: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1557-1557: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1558-1558: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1560-1560: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1561-1561: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1562-1562: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1563-1563: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1565-1565: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1566-1566: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1568-1568: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1569-1569: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1570-1570: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1571-1571: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1572-1572: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1573-1573: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1574-1574: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1577-1577: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1578-1578: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1579-1579: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1580-1580: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1581-1581: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1582-1582: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1583-1583: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1584-1584: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1585-1585: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1587-1587: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1589-1589: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1590-1590: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1591-1591: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1592-1592: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1593-1593: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1594-1594: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1595-1595: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1596-1596: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1597-1597: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1605-1605: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1606-1606: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1381-1381: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

540-553: LGTM!

The code example effectively demonstrates the usage of various monitoring APIs including exception monitoring, namespace monitoring, bootstrap args monitoring, and thread pool monitoring.

docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
docs/zh/client/java-sdk-user-guide.md Outdated Show resolved Hide resolved
@Rawven Rawven force-pushed the docs/observability branch 2 times, most recently from 7647326 to 427f9c4 Compare October 26, 2024 15:54
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
docs/zh/client/java-sdk-user-guide.md (3)

407-435: Improve property documentation format for better readability.

Consider using a more structured properties format with comments explaining each setting:

# Enable Monitor mechanism (ConfigMonitor). Default: false
apollo.client.monitor.enabled=true

# Expose Monitor data via JMX. Default: false
apollo.client.monitor.jmx.enabled=true

# Maximum number of exceptions to store in Monitor. Default: 25
apollo.client.monitor.exception-queue-size=30

# Specify the monitoring system type for exporting metrics (e.g. prometheus). Default: none
apollo.client.monitor.external.type=prometheus

# Export frequency in seconds. Default: 10
apollo.client.monitor.external.export-period=20
🧰 Tools
🪛 LanguageTool

[uncategorized] ~425-~425: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 ```propertie...

(wb4)


539-553: Add descriptions for each monitoring API.

Consider adding brief descriptions of what each monitoring API provides:

// Get the ConfigMonitor instance
ConfigMonitor configMonitor = ConfigService.getConfigMonitor(); 

// Get exception monitoring API - tracks Apollo client exceptions
ApolloClientExceptionMonitorApi exceptionMonitorApi = configMonitor.getExceptionMonitorApi(); 
List<Exception> apolloConfigExceptionList = exceptionMonitorApi.getApolloConfigExceptionList();

// Get namespace monitoring API - tracks namespace status and metrics
ApolloClientNamespaceMonitorApi namespaceMonitorApi = configMonitor.getNamespaceMonitorApi(); 
List<String> namespace404 = namespaceMonitorApi.getNotFoundNamespaces();

// Get bootstrap arguments monitoring API - tracks startup configuration
ApolloClientBootstrapArgsMonitorApi runningParamsMonitorApi = configMonitor.getBootstrapArgsMonitorApi(); 
String bootstrapNamespaces = runningParamsMonitorApi.getBootstrapNamespaces();

// Get thread pool monitoring API - tracks thread pool metrics
ApolloClientThreadPoolMonitorApi threadPoolMonitorApi = configMonitor.getThreadPoolMonitorApi(); 
ApolloThreadPoolInfo remoteConfigRepositoryThreadPoolInfo = threadPoolMonitorApi.getRemoteConfigRepositoryThreadPoolInfo();

1526-1538: Replace tabs with spaces for consistent formatting.

The code uses hard tabs which can cause inconsistent formatting across different editors. Replace tabs with spaces:

    private static final String SKYWALKING = "skywalking";
    private SkywalkingMeterRegistry registry;
    private Map<String, Meter> map;
    private Map<String, Gauge> gaugeMap;
    private Map<String, AtomicReference<Double>> gaugeValues;

    @Override
    public void doInit() {
        registry = new SkywalkingMeterRegistry();
        map = new ConcurrentHashMap<>();
        gaugeValues = new ConcurrentHashMap<>();
        gaugeMap = new ConcurrentHashMap<>();
    }
🧰 Tools
🪛 Markdownlint

1526-1526: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1527-1527: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1528-1528: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1529-1529: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1530-1530: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1532-1532: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1533-1533: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1534-1534: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1535-1535: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1536-1536: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1537-1537: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1538-1538: Column: 1
Hard tabs

(MD010, no-hard-tabs)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a07081b and 8919d2f.

⛔ Files ignored due to path filters (1)
  • doc/images/apollo-client-monitor-jmx.jpg is excluded by !**/*.jpg
📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~425-~425: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:方便"地"扩展
Context: ...Exporter的SPI使可用官方提供的或自己实现),这种设计是为了用户能更方便的扩展。多填,错填和不填则不启用任何Exporter。 ```propertie...

(wb4)


[uncategorized] ~1552-~1552: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

572-572: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


574-574: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


586-586: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


602-602: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


572-572: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


572-572: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


534-534: null
Link fragments should be valid

(MD051, link-fragments)


570-570: null
Link fragments should be valid

(MD051, link-fragments)


1526-1526: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1527-1527: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1528-1528: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1529-1529: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1530-1530: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1532-1532: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1533-1533: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1534-1534: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1535-1535: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1536-1536: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1537-1537: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1538-1538: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1546-1546: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1547-1547: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1548-1548: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1549-1549: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1556-1556: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1557-1557: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1558-1558: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1560-1560: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1561-1561: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1562-1562: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1563-1563: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1565-1565: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1566-1566: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1568-1568: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1569-1569: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1570-1570: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1571-1571: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1572-1572: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1573-1573: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1574-1574: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1577-1577: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1578-1578: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1579-1579: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1580-1580: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1581-1581: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1582-1582: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1583-1583: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1584-1584: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1585-1585: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1587-1587: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1589-1589: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1590-1590: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1591-1591: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1592-1592: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1593-1593: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1594-1594: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1595-1595: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1596-1596: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1597-1597: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1605-1605: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1606-1606: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1381-1381: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

1351-1356: Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable and may not be available to all users.

      <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-plugin-client-prometheus</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.0</version>
      </dependency>

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8919d2f and f6d2467.

⛔ Files ignored due to path filters (1)
  • doc/images/apollo-client-monitor-jmx.jpg is excluded by !**/*.jpg
📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

575-575: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


577-577: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


589-589: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


605-605: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


575-575: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


575-575: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


537-537: null
Link fragments should be valid

(MD051, link-fragments)


573-573: null
Link fragments should be valid

(MD051, link-fragments)


1529-1529: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1530-1530: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1531-1531: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1532-1532: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1533-1533: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1535-1535: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1536-1536: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1537-1537: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1538-1538: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1539-1539: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1540-1540: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1541-1541: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1549-1549: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1550-1550: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1551-1551: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1552-1552: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1559-1559: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1560-1560: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1561-1561: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1563-1563: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1564-1564: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1565-1565: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1566-1566: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1568-1568: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1569-1569: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1571-1571: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1572-1572: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1573-1573: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1574-1574: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1575-1575: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1576-1576: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1577-1577: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1580-1580: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1581-1581: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1582-1582: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1583-1583: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1584-1584: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1585-1585: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1586-1586: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1587-1587: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1588-1588: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1590-1590: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1592-1592: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1593-1593: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1594-1594: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1595-1595: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1596-1596: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1597-1597: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1598-1598: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1599-1599: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1600-1600: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1608-1608: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1609-1609: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1384-1384: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~1555-~1555: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🔇 Additional comments (3)
docs/zh/client/java-sdk-user-guide.md (3)

1357-1357: ⚠️ Potential issue

Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable and may not be available to all users.

-        <version>2.4.0</version>
+        <version>2.4.0</version>

Likely invalid or redundant comment.


1464-1464: ⚠️ Potential issue

Add alt text to the image for accessibility.

The image should have descriptive alt text.

-![](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-prometheus.png)
+![Prometheus console showing Apollo client metrics](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-prometheus.png)

Likely invalid or redundant comment.


431-431: ⚠️ Potential issue

Fix incorrect property name.

The property name should be apollo.client.monitor.external.type instead of prometheus in the comment.

-# 可填配置取决于用户引入的MetricsExporter的SPI
+# 可填配置取决于用户引入的MetricsExporter的SPI,如 prometheus

Likely invalid or redundant comment.


启动应用后,开启J-console或类似工具即可查看,这里用J-console做例子

![showing Apollo client monitoring metrics in JMX](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.jpg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add alt text to the image for accessibility.

The image should have descriptive alt text.

-![](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.jpg)
+![JProfiler showing Apollo client monitoring metrics in JMX](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.jpg)

Committable suggestion was skipped due to low confidence.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
docs/zh/client/java-sdk-user-guide.md (2)

401-440: Improve properties format for better readability and usability.

The configuration documentation is well structured, but the properties format can be improved by using a more copy-paste friendly format with comments.

Consider using this format for the properties:

# Enable Monitor mechanism, ConfigMonitor will be enabled, default is false
apollo.client.monitor.enabled=true

# Expose Monitor data via JMX, can be viewed through tools like J-console, default is false
apollo.client.monitor.jmx.enabled=true

# Maximum number of exceptions stored by Monitor, follows FIFO principle, default is 25
apollo.client.monitor.exception-queue-size=30

# Specify the Exporter type for exporting metrics data to monitoring systems
# Available values depend on the MetricsExporter SPI implementations
apollo.client.monitor.external.type=prometheus

# Specify how often the Exporter exports state information as metrics data, default is 10 seconds
apollo.client.monitor.external.export-period=20

1467-1615: Fix code indentation to use spaces instead of tabs.

The custom monitoring integration documentation is comprehensive, but the code formatting should be consistent.

Replace tabs with spaces in the code examples to maintain consistent formatting throughout the documentation.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~1556-~1556: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🪛 Markdownlint

1530-1530: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1531-1531: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1532-1532: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1533-1533: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1534-1534: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1536-1536: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1537-1537: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1538-1538: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1539-1539: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1540-1540: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1541-1541: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1542-1542: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1550-1550: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1551-1551: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1552-1552: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1553-1553: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1560-1560: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1561-1561: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1562-1562: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1564-1564: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1565-1565: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1566-1566: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1567-1567: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1569-1569: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1570-1570: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1572-1572: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1573-1573: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1574-1574: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1575-1575: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1576-1576: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1577-1577: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1578-1578: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1581-1581: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1582-1582: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1583-1583: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1584-1584: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1585-1585: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1586-1586: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1587-1587: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1588-1588: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1589-1589: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1591-1591: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1593-1593: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1594-1594: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1595-1595: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1596-1596: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1597-1597: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1598-1598: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1599-1599: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1600-1600: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1601-1601: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1609-1609: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1610-1610: Column: 1
Hard tabs

(MD010, no-hard-tabs)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f6d2467 and 6f8cdef.

⛔ Files ignored due to path filters (1)
  • doc/images/apollo-client-monitor-jmx.jpg is excluded by !**/*.jpg
📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (3 hunks)
🧰 Additional context used
🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

576-576: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


578-578: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


590-590: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


606-606: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


576-576: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


576-576: Expected: underscore; Actual: asterisk
Emphasis style

(MD049, emphasis-style)


538-538: null
Link fragments should be valid

(MD051, link-fragments)


574-574: null
Link fragments should be valid

(MD051, link-fragments)


1530-1530: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1531-1531: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1532-1532: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1533-1533: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1534-1534: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1536-1536: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1537-1537: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1538-1538: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1539-1539: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1540-1540: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1541-1541: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1542-1542: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1550-1550: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1551-1551: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1552-1552: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1553-1553: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1560-1560: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1561-1561: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1562-1562: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1564-1564: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1565-1565: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1566-1566: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1567-1567: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1569-1569: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1570-1570: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1572-1572: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1573-1573: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1574-1574: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1575-1575: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1576-1576: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1577-1577: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1578-1578: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1581-1581: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1582-1582: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1583-1583: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1584-1584: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1585-1585: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1586-1586: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1587-1587: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1588-1588: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1589-1589: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1591-1591: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1593-1593: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1594-1594: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1595-1595: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1596-1596: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1597-1597: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1598-1598: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1599-1599: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1600-1600: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1601-1601: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1609-1609: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1610-1610: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1385-1385: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 LanguageTool
docs/zh/client/java-sdk-user-guide.md

[uncategorized] ~1556-~1556: 您的意思是“"既"是”吗?
Context: ...ounterSample,registerOrUpdateGaugeSample即是用来注册Counter,Gauge类型指标的方法,只需要根据传来的参数正常注册...

(JI11_JI2)

🔇 Additional comments (4)
docs/zh/client/java-sdk-user-guide.md (4)

541-557: LGTM! Clear and well-documented API examples.

The ConfigMonitor API documentation provides comprehensive examples with clear comments explaining each monitoring API's purpose.


559-570: Add alt text to the JMX metrics screenshot.

The JMX monitoring documentation is clear, but the screenshot needs alt text for accessibility.

The past review comment about adding alt text is still valid. Please add descriptive alt text to the image:

-![](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.jpg)
+![JProfiler showing Apollo client monitoring metrics in JMX](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/apollo-client-monitor-jmx.jpg)

1354-1359: Replace SNAPSHOT dependency with a stable version.

Using SNAPSHOT versions in documentation examples is not recommended as they are unstable.

The past review comment about using a stable version is still valid. Please update the version:

      <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-plugin-client-prometheus</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0</version>
      </dependency>

1465-1465: Add alt text to the Prometheus metrics screenshot.

The past review comment about adding alt text is still valid. Please add descriptive alt text to the image:

-![](https://raw.githubusercontent.com/Rawven/image/main/20240922125033.png)
+![Prometheus console showing Apollo client metrics](https://raw.githubusercontent.com/Rawven/image/main/20240922125033.png)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants