Skip to content

Service/Application Dependency Graph Implement#1460

Open
ambiguous-pointer wants to merge 6 commits intoapache:developfrom
sohandsomejie:develop
Open

Service/Application Dependency Graph Implement#1460
ambiguous-pointer wants to merge 6 commits intoapache:developfrom
sohandsomejie:develop

Conversation

@ambiguous-pointer
Copy link
Copy Markdown

This change introduces a complete service and application topology visualization feature based on
discussion #1398 and
issue #1430.

It adds both backend graph APIs and frontend AntV G6 visualization for tracing upstream/downstream
relationships via ServiceProviderMetadataResource and ServiceConsumerMetadataResource.


📌 What’s New

  • Application-level topology graph
    GET /application/graph returns provider/consumer application relations as typed nodes
    and edges. Each node declares its type (application) and rule (provider/consumer/empty).

  • Service-level topology graph
    GET /service/graph returns provider/consumer applications for a given service as a graph.
    A central service node is connected to provider and consumer app nodes.

  • Service detail API
    GET /service/detail returns aggregated service metadata (language, method names) derived
    from all provider instances sharing the same serviceKey.

  • Service resource derivation
    ServiceProviderMetadataEventSubscriber now maintains Service resources by aggregating
    methods from all provider instances. Language is auto-detected from provider metadata
    parameters and method type signatures (golang/java).

  • Graph payload structure

    {
        "code": "Success",
        "message": "success",
        "data": {
            "nodes": [
                {
                    "id": "order-service",
                    "label": "order-service",
                    "type": "application",
                    "rule": "provider"
                },
                {
                    "id": "com.ecommerce.api.service.OrderService::",
                    "label": "com.ecommerce.api.service.OrderService::",
                    "type": "service",
                    "rule": ""
                },
                {
                    "id": "payment-service",
                    "label": "payment-service",
                    "type": "application",
                    "rule": "consumer"
                }
            ],
            "edges": [
                {
                    "source": "com.ecommerce.api.service.OrderService::",
                    "target": "order-service",
                    "data": { "type": "provides" }
                },
                {
                    "source": "payment-service",
                    "target": "com.ecommerce.api.service.OrderService::",
                    "data": { "type": "consumes" }
                }
            ]
        }
    }
    
  • Frontend topology visualization
    New Topology tab components for both Applications and Services pages, rendered using AntV G6
    with Vue-node integration. Clicking a node opens a detail drawer.
  • New indexes for efficient queries
    • idx_service_consumer_service_key on ServiceConsumerMetadataKind
    • idx_service_name on ServiceKind
  • Service proto simplification
    Service.{providers,consumers,features} replaced with a single methods []string field,
    derived by aggregating method names from all provider instances.

📁 Affected Areas / Review Checklist

  • Console API (service package handlers)
  • User Experience (graph visualization output)
  • Core Component (discovery subscriber, indexers)
  • Docs
  • Dubboctl
  • Feature

sohandsomejie and others added 6 commits April 16, 2026 20:20
…sion apache#1398

* feat(api): add GraphServices endpoint for service-level topology

Based on discussion apache#1398, use ServiceProviderMetadata and ServiceConsumerMetadata
to return provider/consumer application relations as graph nodes and edges for AntV G6.

* feat(api): add GraphApplications endpoint for application-level topology

Traverse provider/consumer service relations to build application-level graph.
Also add idx_service_consumer_service_key index to support efficient serviceKey queries.

* feat(api): add graph models (GraphNode, GraphEdge, GraphData) in pkg/console/model/graph.go

* feat(api): add ApplicationGraphReq, ServiceGraphReq and GetApplicationGraph, GetServiceGraph handlers

* feat(router): register /application/graph and /service/graph routes

* feat(api): fix error handling to use direct err pass-through instead of MeshNotFoundError
…he#1430](apache#1430))

* feat(api): replace Service.{providers,consumers,features} with {methods} field

Simplify Service proto by removing providers, consumers, and features map,
keeping only the aggregated methods list derived from provider metadata.

* feat(api): derive Service resource from ServiceProviderMetadata on add/update/delete

ServiceProviderMetadataEventSubscriber now maintains Service resources by
aggregating methods from all provider instances sharing the same serviceKey.
Handles add, update, and delete events to keep Service spec in sync.

* feat(api): add language detection from provider metadata parameters

Detect provider language (golang/java) from metadata parameters and method
type signatures when explicit language field is absent.

* feat(api): add GetServiceDetail endpoint returning language and methods

Add GET /service/detail returning ServiceDetailResp with language and
aggregated method names from the derived Service resource.

* feat(api): add BuildServiceIdentityKey helper for {service}:{version}:{group}

* feat(api): add ByServiceName index for ServiceKind

* feat(api): refactor SearchServices to query ServiceResource directly

SearchServices and SearchServicesByKeywords now use ServiceResource instead
of ServiceProviderMetadataResource for service listing.

* feat(api): remove providerAppName from ServiceSearchResp and ServiceTabDistributionReq

* feat(api): add ServiceDetailReq and ServiceDetailResp models

* feat(router): register /service/detail and /service/interfaces routes

* feat(ui-vue3): remove providerAppName from grafana types and tab components
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants