{
  "repo": "tidbcloud/VictoriaMetrics",
  "binary": "vmstorage",
  "binary_path": "app/vmstorage/main.go",
  "dependencies": {
    "Runtime VMStorageLifecycle.Startup": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.OpenStorage": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "storageDataPath is writable"
          ],
          "operations": [
            {
              "operation": "OPEN STORAGE",
              "trigger": "Open the local storage engine with retention, cache, and cardinality-limit options before serving traffic",
              "conditions": [
                "retentionPeriod >= 24h",
                "storageDataPath is accessible"
              ],
              "implementation": "main -> storage.MustOpenStorage(storageDataPath, storage.OpenOptions{...})"
            }
          ]
        }
      },
      "services": []
    },
    "Runtime VMStorageLifecycle.RegisterStorageMetrics": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.RunStaleSnapshotsRemover": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Only when snapshotsMaxAge > 0"
          ],
          "operations": [
            {
              "operation": "DELETE STALE SNAPSHOTS",
              "trigger": "Periodically remove snapshots older than snapshotsMaxAge",
              "conditions": [
                "snapshotsMaxAge.Duration() > 0",
                "ticker fires before staleSnapshotsRemoverCh is closed"
              ],
              "implementation": "initStaleSnapshotsRemover -> go loop -> strg.MustDeleteStaleSnapshots(snapshotsMaxAgeDur)"
            }
          ]
        }
      },
      "services": []
    },
    "Runtime VMStorageLifecycle.StartUnmarshalWorkers": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StartVMInsertServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StartVMSelectServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StartHTTPServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.InitializePushMetrics": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.WaitForSigterm": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StopPushMetrics": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StopHTTPServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StopStaleSnapshotsRemover": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StopVMSelectServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StopVMInsertServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.StopUnmarshalWorkers": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.UnregisterStorageMetrics": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMStorageLifecycle.CloseStorage": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Storage was successfully opened earlier in startup"
          ],
          "operations": [
            {
              "operation": "FLUSH AND CLOSE STORAGE",
              "trigger": "Close the local storage engine after listeners and background workers have stopped",
              "conditions": [
                "shutdown sequence reached storage close"
              ],
              "implementation": "main -> strg.MustClose()"
            }
          ]
        }
      },
      "services": []
    },
    "Runtime VMStorageLifecycle.StopDirRemover": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /internal/force_merge": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "forceMergeAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "FORCE MERGE PARTITIONS",
              "trigger": "Start a background forced merge over partitions matching partition_prefix",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, forceMergeAuthKey) == true"
              ],
              "implementation": "requestHandler -> go strg.ForceMergePartitions(partitionNamePrefix)"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP ANY /internal/force_flush": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "forceFlushAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "FLUSH PENDING DATA",
              "trigger": "Make in-memory pending rows visible to read paths immediately",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, forceFlushAuthKey) == true"
              ],
              "implementation": "requestHandler -> strg.DebugFlush()"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP ANY /snapshot/create": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "snapshotAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "CREATE SNAPSHOT",
              "trigger": "Create a new storage snapshot and return its name",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, snapshotAuthKey) == true"
              ],
              "implementation": "requestHandler -> strg.MustCreateSnapshot()"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP ANY /snapshot/list": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "snapshotAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "LIST SNAPSHOTS",
              "trigger": "Enumerate existing snapshots for the local storage",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, snapshotAuthKey) == true"
              ],
              "implementation": "requestHandler -> strg.MustListSnapshots()"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP ANY /snapshot/delete": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "snapshotAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "DELETE SNAPSHOT",
              "trigger": "Delete a named snapshot after verifying it exists in the current snapshot list",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, snapshotAuthKey) == true",
                "snapshot query parameter matches an existing snapshot"
              ],
              "implementation": "requestHandler -> strg.MustListSnapshots() -> strg.DeleteSnapshot(snapshotName)"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP ANY /snapshot/delete_all": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "snapshotAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "DELETE ALL SNAPSHOTS",
              "trigger": "Delete every current snapshot for the local storage",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, snapshotAuthKey) == true"
              ],
              "implementation": "requestHandler -> strg.MustListSnapshots() -> loop strg.DeleteSnapshot(snapshotName)"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP GET /health": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /ping": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /metrics": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /-/healthy": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /-/ready": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /debug/pprof/*": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /favicon.ico": {
      "infrastructure": {},
      "services": []
    },
    "VMStorageVMInsertProtocol.StreamRows": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "VMInsert handshake succeeds",
            "stream.Parse keeps decoding rows",
            "storage is not in read-only mode"
          ],
          "operations": [
            {
              "operation": "WRITE METRIC ROWS",
              "trigger": "Consume cluster-native metric rows from vminsert and append them to local storage",
              "conditions": [
                "handshake.VMInsertServer(c, compressionLevel) succeeds",
                "stream.Parse(...) yields rows"
              ],
              "implementation": "VMInsertServer.run -> stream.Parse -> s.storage.AddRows(rows, precisionBits)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.search_v7": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration",
            "If denyQueriesOutsideRetention is enabled, the query time range stays within retention",
            "SearchQuery tag filters are not empty"
          ],
          "operations": [
            {
              "operation": "READ METRIC BLOCKS",
              "trigger": "Execute the main vmselect search RPC and stream metric blocks back to vmselect",
              "conditions": [
                "processRPC dispatches rpcName search_v7",
                "InitSearch succeeds"
              ],
              "implementation": "vmselectapi.Server.processSearch -> api.InitSearch -> storage.Search.Init(...) -> blockIterator.NextBlock"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.searchMetricNames_v3": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ METRIC NAMES",
              "trigger": "Return metric names matching the SearchQuery filters",
              "conditions": [
                "processRPC dispatches rpcName searchMetricNames_v3"
              ],
              "implementation": "vmselectapi.Server.processSearchMetricNames -> api.SearchMetricNames -> api.s.SearchMetricNames(...)"
            },
            {
              "operation": "READ GRAPHITE PATHS",
              "trigger": "Resolve __graphite__ tag filters into concrete paths before searching metric names",
              "conditions": [
                "Any SearchQuery tag filter key is __graphite__"
              ],
              "implementation": "api.setupTfss -> api.s.SearchGraphitePaths(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.labelValues_v5": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ LABEL VALUES",
              "trigger": "Return label values for a given labelName under the supplied SearchQuery",
              "conditions": [
                "processRPC dispatches rpcName labelValues_v5"
              ],
              "implementation": "vmselectapi.Server.processLabelValues -> api.LabelValues -> api.s.SearchLabelValues(...)"
            },
            {
              "operation": "READ GRAPHITE PATHS",
              "trigger": "Resolve __graphite__ tag filters before label-value search",
              "conditions": [
                "Any SearchQuery tag filter key is __graphite__"
              ],
              "implementation": "api.setupTfss -> api.s.SearchGraphitePaths(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.tagValueSuffixes_v4": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ TAG VALUE SUFFIXES",
              "trigger": "Return suffix matches for Graphite-like /metrics/find queries",
              "conditions": [
                "processRPC dispatches rpcName tagValueSuffixes_v4"
              ],
              "implementation": "vmselectapi.Server.processTagValueSuffixes -> api.TagValueSuffixes -> api.s.SearchTagValueSuffixes(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.labelNames_v5": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ LABEL NAMES",
              "trigger": "Return label names matching the supplied SearchQuery",
              "conditions": [
                "processRPC dispatches rpcName labelNames_v5"
              ],
              "implementation": "vmselectapi.Server.processLabelNames -> api.LabelNames -> api.s.SearchLabelNames(...)"
            },
            {
              "operation": "READ GRAPHITE PATHS",
              "trigger": "Resolve __graphite__ tag filters before label-name search",
              "conditions": [
                "Any SearchQuery tag filter key is __graphite__"
              ],
              "implementation": "api.setupTfss -> api.s.SearchGraphitePaths(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.seriesCount_v4": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ SERIES COUNT",
              "trigger": "Return series cardinality for the supplied tenant",
              "conditions": [
                "processRPC dispatches rpcName seriesCount_v4"
              ],
              "implementation": "vmselectapi.Server.processSeriesCount -> api.SeriesCount -> api.s.GetSeriesCount(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.tsdbStatus_v6": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ TSDB STATUS",
              "trigger": "Return TSDB status aggregates for the supplied SearchQuery and focusLabel",
              "conditions": [
                "processRPC dispatches rpcName tsdbStatus_v6"
              ],
              "implementation": "vmselectapi.Server.processTSDBStatus -> api.TSDBStatus -> api.s.GetTSDBStatus(...)"
            },
            {
              "operation": "READ GRAPHITE PATHS",
              "trigger": "Resolve __graphite__ tag filters before TSDB status search",
              "conditions": [
                "Any SearchQuery tag filter key is __graphite__"
              ],
              "implementation": "api.setupTfss -> api.s.SearchGraphitePaths(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.deleteSeries_v5": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration",
            "SearchQuery tag filters are not empty"
          ],
          "operations": [
            {
              "operation": "DELETE SERIES",
              "trigger": "Delete series matching the supplied SearchQuery",
              "conditions": [
                "processRPC dispatches rpcName deleteSeries_v5"
              ],
              "implementation": "vmselectapi.Server.processDeleteSeries -> api.DeleteSeries -> api.s.DeleteSeries(tfss, maxMetrics)"
            },
            {
              "operation": "READ GRAPHITE PATHS",
              "trigger": "Resolve __graphite__ tag filters before delete-series execution",
              "conditions": [
                "Any SearchQuery tag filter key is __graphite__"
              ],
              "implementation": "api.setupTfss -> api.s.SearchGraphitePaths(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.registerMetricNames_v3": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "REGISTER METRIC NAMES",
              "trigger": "Persist metric-name metadata passed from vmselect",
              "conditions": [
                "processRPC dispatches rpcName registerMetricNames_v3"
              ],
              "implementation": "vmselectapi.Server.processRegisterMetricNames -> api.RegisterMetricNames -> api.s.RegisterMetricNames(qt, mrs)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.tenants_v1": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ TENANTS",
              "trigger": "Return tenants that exist in the supplied time range",
              "conditions": [
                "processRPC dispatches rpcName tenants_v1"
              ],
              "implementation": "vmselectapi.Server.processTenants -> api.Tenants -> api.s.SearchTenants(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.metricNamesUsageStats_v1": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "READ METRIC NAME USAGE STATS",
              "trigger": "Return metric name usage statistics for the requested tenant/filter scope",
              "conditions": [
                "processRPC dispatches rpcName metricNamesUsageStats_v1"
              ],
              "implementation": "vmselectapi.Server.processMetricNamesUsageStats -> api.GetMetricNamesUsageStats -> api.s.GetMetricNamesStats(...)"
            }
          ]
        }
      },
      "services": []
    },
    "VMStorageVMSelectRPC.resetMetricNamesStats_v1": {
      "infrastructure": {
        "local_storage": {
          "conditions": [
            "vmselect RPC concurrency slot is acquired or queued within MaxQueueDuration"
          ],
          "operations": [
            {
              "operation": "RESET METRIC NAME STATS",
              "trigger": "Reset the metric-name usage tracker state",
              "conditions": [
                "processRPC dispatches rpcName resetMetricNamesStats_v1"
              ],
              "implementation": "vmselectapi.Server.processResetMetricUsageStats -> api.ResetMetricNamesUsageStats -> api.s.ResetMetricNamesStats(qt)"
            }
          ]
        }
      },
      "services": []
    }
  },
  "notes": [
    "The previous app-vmstorage mapping collapsed the whole binary into HTTPAdminAPI.*, VMInsertServer.*, and VMSelectServer.* blobs and also inherited a fake /-/reload route.",
    "The fresh mapping follows runtime truth: the HTTP admin surface is local-storage/filesystem control only, vminsert is a single streaming ingest protocol, and vmselect is a 12-action RPC server with per-action read/write semantics.",
    "Graphite tag-filter expansion is modeled as a conditional local-storage read inside the vmselect search methods that call setupTfss, instead of as a separate fake public interface."
  ]
}
