{
  "repo": "tidbcloud/VictoriaMetrics",
  "binary": "vmstorage",
  "binary_path": "app/vmstorage/main.go",
  "services": [
    {
      "name": "VMStorageLifecycle",
      "package": "main",
      "methods": [
        {
          "name": "Startup",
          "input": "flags + environment variables",
          "output": "initialized storage limits, opened local storage, started vminsert/vmselect/http listeners, and pushmetrics loop",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.Startup"
        },
        {
          "name": "OpenStorage",
          "input": "storageDataPath + retention options + cache settings",
          "output": "opened local storage engine and registered retention/cache behavior",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.OpenStorage"
        },
        {
          "name": "RegisterStorageMetrics",
          "input": "opened storage handle",
          "output": "registered vmstorage-specific metrics writer",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.RegisterStorageMetrics"
        },
        {
          "name": "RunStaleSnapshotsRemover",
          "input": "snapshotsMaxAge + opened storage handle",
          "output": "background stale snapshot cleanup loop",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.RunStaleSnapshotsRemover"
        },
        {
          "name": "StartUnmarshalWorkers",
          "input": "protoparser worker settings",
          "output": "running parser worker pool for incoming vminsert traffic",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StartUnmarshalWorkers"
        },
        {
          "name": "StartVMInsertServer",
          "input": "vminsertAddr + precisionBits + storage handle",
          "output": "TCP listener accepting vminsert cluster-native ingestion traffic",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StartVMInsertServer"
        },
        {
          "name": "StartVMSelectServer",
          "input": "vmselectAddr + search limits + storage handle",
          "output": "TCP listener accepting vmselect RPC traffic",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StartVMSelectServer"
        },
        {
          "name": "StartHTTPServer",
          "input": "httpListenAddr + optional proxy-protocol",
          "output": "HTTP listener serving admin routes and builtin httpserver routes",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StartHTTPServer"
        },
        {
          "name": "InitializePushMetrics",
          "input": "pushmetrics flags",
          "output": "optional pushmetrics loop",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.InitializePushMetrics"
        },
        {
          "name": "WaitForSigterm",
          "input": "SIGINT or SIGTERM",
          "output": "shutdown trigger",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.WaitForSigterm"
        },
        {
          "name": "StopPushMetrics",
          "input": "shutdown signal",
          "output": "terminated pushmetrics loop",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StopPushMetrics"
        },
        {
          "name": "StopHTTPServer",
          "input": "httpListenAddr list",
          "output": "gracefully stopped main HTTP listeners",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StopHTTPServer"
        },
        {
          "name": "StopStaleSnapshotsRemover",
          "input": "staleSnapshotsRemover channel and waitgroup",
          "output": "stopped stale snapshot cleanup loop",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StopStaleSnapshotsRemover"
        },
        {
          "name": "StopVMSelectServer",
          "input": "vmselect server state",
          "output": "closed vmselect listener and all active RPC connections",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StopVMSelectServer"
        },
        {
          "name": "StopVMInsertServer",
          "input": "vminsert server state",
          "output": "closed vminsert listener and drained active ingest connections",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StopVMInsertServer"
        },
        {
          "name": "StopUnmarshalWorkers",
          "input": "parser worker pool state",
          "output": "stopped parser workers",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StopUnmarshalWorkers"
        },
        {
          "name": "UnregisterStorageMetrics",
          "input": "registered storage metrics set",
          "output": "removed vmstorage metrics writer from global registry",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.UnregisterStorageMetrics"
        },
        {
          "name": "CloseStorage",
          "input": "opened storage handle",
          "output": "flushed and closed local storage",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.CloseStorage"
        },
        {
          "name": "StopDirRemover",
          "input": "fs dir remover state",
          "output": "stopped background temporary directory remover",
          "type": "local",
          "name_key": "Runtime VMStorageLifecycle.StopDirRemover"
        }
      ]
    },
    {
      "name": "VMStorageHTTP",
      "type": "http",
      "methods": [
        {
          "name": "GET /",
          "input": "none",
          "output": "vmstorage info HTML",
          "path": "/",
          "type": "http",
          "name_key": "HTTP GET /"
        },
        {
          "name": "ANY /internal/force_merge",
          "input": "partition_prefix query parameter + forceMergeAuthKey",
          "output": "accepted background force-merge request",
          "path": "/internal/force_merge",
          "type": "http",
          "name_key": "HTTP ANY /internal/force_merge"
        },
        {
          "name": "ANY /internal/force_flush",
          "input": "forceFlushAuthKey",
          "output": "flushed pending in-memory data to make it queryable",
          "path": "/internal/force_flush",
          "type": "http",
          "name_key": "HTTP ANY /internal/force_flush"
        },
        {
          "name": "ANY /snapshot/create",
          "input": "snapshotAuthKey",
          "output": "JSON response with created snapshot name",
          "path": "/snapshot/create",
          "type": "http",
          "name_key": "HTTP ANY /snapshot/create"
        },
        {
          "name": "ANY /snapshot/list",
          "input": "snapshotAuthKey",
          "output": "JSON response listing available snapshots",
          "path": "/snapshot/list",
          "type": "http",
          "name_key": "HTTP ANY /snapshot/list"
        },
        {
          "name": "ANY /snapshot/delete",
          "input": "snapshotAuthKey + snapshot query parameter",
          "output": "JSON ok or error when deleting a named snapshot",
          "path": "/snapshot/delete",
          "type": "http",
          "name_key": "HTTP ANY /snapshot/delete"
        },
        {
          "name": "ANY /snapshot/delete_all",
          "input": "snapshotAuthKey",
          "output": "JSON ok or error after deleting every snapshot",
          "path": "/snapshot/delete_all",
          "type": "http",
          "name_key": "HTTP ANY /snapshot/delete_all"
        },
        {
          "name": "GET /health",
          "input": "none",
          "output": "health response from lib/httpserver",
          "path": "/health",
          "type": "http",
          "name_key": "HTTP GET /health"
        },
        {
          "name": "ANY /ping",
          "input": "none",
          "output": "ping response from lib/httpserver",
          "path": "/ping",
          "type": "http",
          "name_key": "HTTP ANY /ping"
        },
        {
          "name": "GET /metrics",
          "input": "optional metricsAuthKey",
          "output": "Prometheus metrics for vmstorage",
          "path": "/metrics",
          "type": "http",
          "name_key": "HTTP GET /metrics"
        },
        {
          "name": "GET /-/healthy",
          "input": "none",
          "output": "healthy response from lib/httpserver",
          "path": "/-/healthy",
          "type": "http",
          "name_key": "HTTP GET /-/healthy"
        },
        {
          "name": "GET /-/ready",
          "input": "none",
          "output": "ready response from lib/httpserver",
          "path": "/-/ready",
          "type": "http",
          "name_key": "HTTP GET /-/ready"
        },
        {
          "name": "GET /debug/pprof/*",
          "input": "optional pprofAuthKey",
          "output": "pprof diagnostics from lib/httpserver",
          "path": "/debug/pprof/*",
          "type": "http",
          "name_key": "HTTP GET /debug/pprof/*"
        },
        {
          "name": "GET */favicon.ico",
          "input": "favicon request",
          "output": "built-in favicon response",
          "path": "/favicon.ico",
          "type": "http",
          "name_key": "HTTP GET /favicon.ico"
        }
      ]
    },
    {
      "name": "VMStorageVMInsertProtocol",
      "package": "servers",
      "methods": [
        {
          "name": "StreamRows",
          "input": "cluster-native vminsert TCP stream",
          "output": "accepted metric rows written into local storage",
          "type": "tcp",
          "name_key": "VMStorageVMInsertProtocol.StreamRows"
        }
      ]
    },
    {
      "name": "VMStorageVMSelectRPC",
      "package": "vmselectapi",
      "methods": [
        {
          "name": "search_v7",
          "input": "SearchQuery + timeout",
          "output": "stream of metric blocks",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.search_v7"
        },
        {
          "name": "searchMetricNames_v3",
          "input": "SearchQuery + timeout",
          "output": "metric name list",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.searchMetricNames_v3"
        },
        {
          "name": "labelValues_v5",
          "input": "labelName + SearchQuery + timeout",
          "output": "label value list",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.labelValues_v5"
        },
        {
          "name": "tagValueSuffixes_v4",
          "input": "tenant + time range + tag key/prefix + delimiter + timeout",
          "output": "tag value suffix list",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.tagValueSuffixes_v4"
        },
        {
          "name": "labelNames_v5",
          "input": "SearchQuery + timeout",
          "output": "label name list",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.labelNames_v5"
        },
        {
          "name": "seriesCount_v4",
          "input": "tenant + timeout",
          "output": "series count",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.seriesCount_v4"
        },
        {
          "name": "tsdbStatus_v6",
          "input": "SearchQuery + focusLabel + topN + timeout",
          "output": "TSDB status summary",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.tsdbStatus_v6"
        },
        {
          "name": "deleteSeries_v5",
          "input": "SearchQuery + timeout",
          "output": "deleted series count",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.deleteSeries_v5"
        },
        {
          "name": "registerMetricNames_v3",
          "input": "metric row list + timeout",
          "output": "empty success response",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.registerMetricNames_v3"
        },
        {
          "name": "tenants_v1",
          "input": "time range + timeout",
          "output": "tenant list",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.tenants_v1"
        },
        {
          "name": "metricNamesUsageStats_v1",
          "input": "optional tenant + filters + timeout",
          "output": "metric name usage stats response",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.metricNamesUsageStats_v1"
        },
        {
          "name": "resetMetricNamesStats_v1",
          "input": "timeout",
          "output": "empty success response",
          "type": "tcp_rpc",
          "name_key": "VMStorageVMSelectRPC.resetMetricNamesStats_v1"
        }
      ]
    }
  ],
  "surface_kind": "mixed_service",
  "extensions": {
    "notes": [
      "The previous app-vmstorage interface used the legacy endpoint/blob schema and even carried a non-existent /-/reload route.",
      "The fresh interface models vmstorage as one deployable binary with four distinct runtime surfaces: lifecycle, HTTP admin/builtin routes, vminsert cluster-native ingestion, and the vmselect RPC server.",
      "Builtin lib/httpserver routes are part of the main HTTP listener, but /-/reload is not; vmstorage's requestHandler never registers a reload endpoint.",
      "The vmselect surface is request-driven over a custom RPC protocol, so the method set comes from rpcName dispatch in vmselectapi.Server rather than from HTTP routes."
    ]
  }
}
