MATIH Platform is in active MVP development. Documentation reflects current implementation status.
8. Platform Services
Topology

Topology

The TopologyController and TopologyRefreshService provide a real-time view of the platform's infrastructure topology. This includes service dependencies, resource utilization, connectivity status, and the overall health of the deployment across namespaces and cloud regions.


Topology Endpoint

Endpoint: GET /api/v1/infrastructure/topology

Returns the full platform topology including all tenants, services, and their relationships.

curl http://localhost:8089/api/v1/infrastructure/topology \
  -H "Authorization: Bearer ${TOKEN}"

Tenant Topology

Endpoint: GET /api/v1/infrastructure/topology/tenants/:tenantId

Returns the topology for a specific tenant, including all deployed services, their health status, and interdependencies.


Topology Data Model

Nodes

Each service or resource in the topology is represented as a node:

FieldTypeDescription
idStringNode identifier
typeStringservice, database, cache, queue, storage
nameStringDisplay name
namespaceStringKubernetes namespace
statusStringhealthy, degraded, unhealthy, unknown
versionStringDeployed version
replicasintCurrent replica count
metricsObjectCPU, memory, request rate, error rate

Edges

Dependencies between nodes are represented as edges:

FieldTypeDescription
sourceStringSource node ID
targetStringTarget node ID
typeStringhttp, grpc, tcp, kafka
latencyP50doubleMedian latency between nodes
errorRatedoubleError rate of the connection

Topology Refresh

The TopologyRefreshService periodically refreshes the topology view by:

  1. Querying Kubernetes API for current pod, service, and deployment state
  2. Collecting metrics from Prometheus for request rates and latencies
  3. Analyzing service mesh data for dependency mapping
  4. Aggregating health check results from the HealthCheckService

Infrastructure Metrics

The InfrastructureMetrics class exposes Prometheus metrics for infrastructure monitoring:

MetricTypeDescription
infrastructure_provisioning_durationHistogramTime to provision infrastructure
infrastructure_reconciliation_durationHistogramReconciliation loop duration
infrastructure_drift_detectedCounterNumber of drift detections
infrastructure_services_totalGaugeTotal deployed services
infrastructure_services_healthyGaugeHealthy service count

Cloud Provider Integration

The AzureResourceProviderService and CloudClientConfig provide cloud-specific resource queries for topology enrichment. This includes:

  • Virtual machine and AKS cluster state
  • Database server health
  • Storage account utilization
  • Network connectivity status