[GSoC 2025] Add discovery-timeline QoS command to display real-time service discovery metadata
Issue https://github.com/apache/dubbo/issues/15212
Description
introduces a new command to the Dubbo QoS module: discovery-timeline. This command improves transparency into the service discovery process by listing active provider services along with their last known metadata update times and registry sources. It is designed to help developers and operators quickly inspect the current discovery state without diving deep into logs or complex diagnostics.
Benefits
- Providing a clear overview of all discovered services
- Displaying when each service was last reported via metadata
- Showing which registries are active and when they last refreshed
- Diagnosing service visibility or registration issues
- Monitoring refresh delays from registry sources
- Validating service registration during application startup or scaling events
Command Overview
Command: discovery-timeline
Used Examples: discovery-timeline discovery-timeline service=DemoService discovery-timeline registry=zookeeper://localhost:2181 discovery-timeline page=2 limit=5
Output Example
Discovery Timeline
------------------------------------------------------------
Registry |Last Refresh
------------------------------------------------------------
127.0.0.1:2181 |Mon Jul 28 01:15:12 IST 2025
------------------------------------------------------------
Provider Services
Discovered: org.apache.dubbo.DemoService |Mon Jul 28 01:15:12 IST 2025
Discovered: org.apache.dubbo.MetadataService |Mon Jul 28 01:15:12 IST 2025
------------------------------------------------------------
Tests Included
Verified On
$ telnet 127.0.0.1 22222
dubbo> discovery-timeline
please take a look @AlbumenJ @songxiaosheng
use spotless format your code
- should not configure artifacts for testing because
dubbo-dependencies-bomhas defined all artifacts dependencies for testing purpose. - should not configure building configuration at module because it should be set at
dubbo-parentpom.xml to support building dubbo with different jdk versions. - should use jdk21+ to build or test your PR, including run
mvn spotless:applyto meet Dubbo code format requirements.
Codecov Report
:x: Patch coverage is 63.86139% with 73 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 61.05%. Comparing base (ed65284) to head (04b7a9a).
:warning: Report is 1 commits behind head on 3.3.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...bbo/qos/command/impl/DiscoveryTimelineCommand.java | 63.86% | 56 Missing and 17 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## 3.3 #15590 +/- ##
============================================
+ Coverage 61.02% 61.05% +0.03%
- Complexity 11500 11692 +192
============================================
Files 1909 1910 +1
Lines 86782 86984 +202
Branches 13094 13134 +40
============================================
+ Hits 52961 53111 +150
- Misses 28409 28441 +32
- Partials 5412 5432 +20
| Flag | Coverage Δ | |
|---|---|---|
| integration-tests-java21 | 32.93% <1.49%> (-0.13%) |
:arrow_down: |
| integration-tests-java8 | 32.99% <1.49%> (-0.12%) |
:arrow_down: |
| samples-tests-java21 | 32.65% <1.49%> (+0.97%) |
:arrow_up: |
| samples-tests-java8 | 30.24% <1.49%> (+0.92%) |
:arrow_up: |
| unit-tests-java11 | 59.07% <63.68%> (-0.02%) |
:arrow_down: |
| unit-tests-java17 | 58.80% <63.68%> (+0.01%) |
:arrow_up: |
| unit-tests-java21 | 58.80% <63.68%> (+0.04%) |
:arrow_up: |
| unit-tests-java8 | 59.08% <63.86%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Please take a look @RainYuY @zrlw
Please take a look @RainYuY @zrlw
Please take a look at the reason for the action failure. One of the issues is that you didn’t add a license header.
ERROR: The following files don't have a valid license header: dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand
Dubbo has it's own logger.warn or logger.error codes requirements, you'd better search existed codes to find how to write them.
Please take a look @RainYuY @zrlw
Please take a look at the reason for the action failure. One of the issues is that you didn’t add a license header.
ERROR: The following files don't have a valid license header: dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand
added manually
ERROR: The following files don't have a valid license header: dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand
added manually
The cause is org.apache.dubbo.qos.api.BaseCommand should not be added to the wrong location dubbo-plugin/dubbo-qos/META-INF, all files that not existed in resources will be checked to ensure the license header was added.
Remove all System.out statements or log them refer to LsTest.java
ERROR: The following files don't have a valid license header: dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand
added manually
The cause is
org.apache.dubbo.qos.api.BaseCommandshould not be added to the wrong locationdubbo-plugin/dubbo-qos/META-INF, all files that not existed inresourceswill be checked to ensure the license header was added.
not in
dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/already placed atdubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommandand still checking for licence header
- deleted
dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommandby https://github.com/apache/dubbo/pull/15590/commits/b9bfc4c0fa41a8762db9b9f4e162e258e2a3ed98 - removed license header from
dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommandby https://github.com/apache/dubbo/pull/15590/commits/c4a89a1755f12429cd0f03f8a394e2380ba4b030
see the result:
https://github.com/apache/dubbo/actions/runs/16639460109
you'd better search some documents about how to solve git merge conflicts, force-merge should not be used if you are not familiar with the codes.
and the codes which are not related to the issue which you fixed should not be changed, you'd better check them in https://github.com/apache/dubbo/pull/15590/files or your local develope IDE.
@zrlw do any further modifications are required for this PR?
@zrlw do any further modifications are required for this PR?
waiting for other reviewers checking.
@zrlw do any further modifications are required for this PR?
waiting for other reviewers checking.
thanks for clarification.