dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

[GSoC 2025] Add discovery-timeline QoS command to display real-time service discovery metadata

Open ankitshokeen opened this issue 4 months ago • 16 comments

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

  1. Providing a clear overview of all discovered services
  2. Displaying when each service was last reported via metadata
  3. Showing which registries are active and when they last refreshed
  4. Diagnosing service visibility or registration issues
  5. Monitoring refresh delays from registry sources
  6. 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

ankitshokeen avatar Jul 27 '25 21:07 ankitshokeen

please take a look @AlbumenJ @songxiaosheng

ankitshokeen avatar Jul 27 '25 21:07 ankitshokeen

use spotless format your code

RainYuY avatar Jul 28 '25 02:07 RainYuY

  1. should not configure artifacts for testing because dubbo-dependencies-bom has defined all artifacts dependencies for testing purpose.
  2. should not configure building configuration at module because it should be set at dubbo-parent pom.xml to support building dubbo with different jdk versions.
  3. should use jdk21+ to build or test your PR, including run mvn spotless:apply to meet Dubbo code format requirements.

zrlw avatar Jul 28 '25 02:07 zrlw

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.

codecov-commenter avatar Jul 28 '25 20:07 codecov-commenter

Please take a look @RainYuY @zrlw

ankitshokeen avatar Jul 28 '25 21:07 ankitshokeen

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

RainYuY avatar Jul 29 '25 01:07 RainYuY

faebce44-1aed-4e6b-ab30-5425aae095c5

Dubbo has it's own logger.warn or logger.error codes requirements, you'd better search existed codes to find how to write them.

zrlw avatar Jul 29 '25 05:07 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

added manually

ankitshokeen avatar Jul 29 '25 21:07 ankitshokeen

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.

zrlw avatar Jul 30 '25 01:07 zrlw

Remove all System.out statements or log them refer to LsTest.java

zrlw avatar Jul 30 '25 02:07 zrlw

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.

Screenshot From 2025-07-31 02-44-35 not in `dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/` already placed at `dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand` and still checking for licence header

ankitshokeen avatar Jul 30 '25 21:07 ankitshokeen

not in dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/ already placed at dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand and still checking for licence header

  1. deleted dubbo-plugin/dubbo-qos/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand by https://github.com/apache/dubbo/pull/15590/commits/b9bfc4c0fa41a8762db9b9f4e162e258e2a3ed98
  2. removed license header from dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.qos.api.BaseCommand by https://github.com/apache/dubbo/pull/15590/commits/c4a89a1755f12429cd0f03f8a394e2380ba4b030

see the result: https://github.com/apache/dubbo/actions/runs/16639460109 7f8d1512-ff10-4591-91cd-15b1ef0fbff9

zrlw avatar Jul 31 '25 04:07 zrlw

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 avatar Jul 31 '25 04:07 zrlw

@zrlw do any further modifications are required for this PR?

ankitshokeen avatar Aug 01 '25 09:08 ankitshokeen

@zrlw do any further modifications are required for this PR?

waiting for other reviewers checking.

zrlw avatar Aug 02 '25 01:08 zrlw

@zrlw do any further modifications are required for this PR?

waiting for other reviewers checking.

thanks for clarification.

ankitshokeen avatar Aug 02 '25 19:08 ankitshokeen