{
  "repo": "tidbcloud/VictoriaMetrics",
  "binary": "vmalert",
  "binary_path": "app/vmalert/main.go",
  "surface_kind": "mixed_service",
  "services": [
    {
      "name": "VMAlertLifecycle",
      "package": "main",
      "methods": [
        {
          "name": "ResolveExternalURL",
          "name_key": "Runtime VMAlertLifecycle.ResolveExternalURL",
          "input": "external.url + httpListenAddr + tls flags",
          "output": "effective external URL",
          "type": "local"
        },
        {
          "name": "LoadTemplates",
          "name_key": "Runtime VMAlertLifecycle.LoadTemplates",
          "input": "rule.templates + external URL",
          "output": "loaded template set",
          "type": "local"
        },
        {
          "name": "DryRunValidateRules",
          "name_key": "Runtime VMAlertLifecycle.DryRunValidateRules",
          "input": "rule files + template validation settings",
          "output": "validated rules and immediate process exit",
          "type": "local"
        },
        {
          "name": "InitializeAlertURLGenerator",
          "name_key": "Runtime VMAlertLifecycle.InitializeAlertURLGenerator",
          "input": "external.alert.source + external URL + rule.validateTemplates",
          "output": "alert source URL generator",
          "type": "local"
        },
        {
          "name": "InitializeReplayRemoteWrite",
          "name_key": "Runtime VMAlertLifecycle.InitializeReplayRemoteWrite",
          "input": "remoteWrite.url and related config",
          "output": "replay remote-write client",
          "type": "local"
        },
        {
          "name": "InitializeReplayDatasource",
          "name_key": "Runtime VMAlertLifecycle.InitializeReplayDatasource",
          "input": "datasource.url with nocache=1",
          "output": "replay datasource querier",
          "type": "local"
        },
        {
          "name": "RunReplay",
          "name_key": "Runtime VMAlertLifecycle.RunReplay",
          "input": "parsed groups + replay time range + replay concurrency settings",
          "output": "historical replay result and remote-write flush",
          "type": "local"
        },
        {
          "name": "InitializeManager",
          "name_key": "Runtime VMAlertLifecycle.InitializeManager",
          "input": "datasource + notifier + remoteWrite + remoteRead + external labels",
          "output": "manager with query, notifier, remote-write, and remote-read builders",
          "type": "local"
        },
        {
          "name": "ParseInitialRules",
          "name_key": "Runtime VMAlertLifecycle.ParseInitialRules",
          "input": "rule files + validation settings",
          "output": "initial group config set",
          "type": "local"
        },
        {
          "name": "StartManager",
          "name_key": "Runtime VMAlertLifecycle.StartManager",
          "input": "parsed groups + restore mode",
          "output": "running rule groups",
          "type": "local"
        },
        {
          "name": "StartConfigReloadLoop",
          "name_key": "Runtime VMAlertLifecycle.StartConfigReloadLoop",
          "input": "configCheckInterval + SIGHUP channel + manager + current group config",
          "output": "background config reload runtime",
          "type": "local"
        },
        {
          "name": "StartHTTPServer",
          "name_key": "Runtime VMAlertLifecycle.StartHTTPServer",
          "input": "httpListenAddr + httpListenAddr.useProxyProtocol",
          "output": "HTTP listener serving builtin routes, UI, APIs, and reload endpoint",
          "type": "local"
        },
        {
          "name": "InitializePushMetrics",
          "name_key": "Runtime VMAlertLifecycle.InitializePushMetrics",
          "input": "pushmetrics flags",
          "output": "optional pushmetrics loop",
          "type": "local"
        },
        {
          "name": "WaitForSigterm",
          "name_key": "Runtime VMAlertLifecycle.WaitForSigterm",
          "input": "SIGINT or SIGTERM",
          "output": "shutdown trigger",
          "type": "local"
        },
        {
          "name": "StopPushMetrics",
          "name_key": "Runtime VMAlertLifecycle.StopPushMetrics",
          "input": "shutdown signal",
          "output": "terminated pushmetrics loop",
          "type": "local"
        },
        {
          "name": "StopHTTPServer",
          "name_key": "Runtime VMAlertLifecycle.StopHTTPServer",
          "input": "httpListenAddr list",
          "output": "stopped HTTP listeners",
          "type": "local"
        },
        {
          "name": "StopManager",
          "name_key": "Runtime VMAlertLifecycle.StopManager",
          "input": "manager runtime",
          "output": "closed remote-write client and stopped rule-group goroutines",
          "type": "local"
        }
      ]
    },
    {
      "name": "VMAlertBuiltinHTTP",
      "type": "http",
      "methods": [
        {
          "name": "ANY /health",
          "name_key": "HTTP ANY /health",
          "input": "health probe",
          "output": "OK or delayed-shutdown status",
          "path": "/health",
          "type": "http"
        },
        {
          "name": "ANY /ping",
          "name_key": "HTTP ANY /ping",
          "input": "optional verbose query arg",
          "output": "Influx-compatible ping response",
          "path": "/ping",
          "type": "http"
        },
        {
          "name": "ANY /metrics",
          "name_key": "HTTP ANY /metrics",
          "input": "optional authKey query arg",
          "output": "Prometheus metrics",
          "path": "/metrics",
          "type": "http"
        },
        {
          "name": "ANY /flags",
          "name_key": "HTTP ANY /flags",
          "input": "optional authKey query arg",
          "output": "effective process flags",
          "path": "/flags",
          "type": "http"
        },
        {
          "name": "ANY /-/healthy",
          "name_key": "HTTP ANY /-/healthy",
          "input": "Prometheus compatibility probe",
          "output": "VictoriaMetrics is Healthy",
          "path": "/-/healthy",
          "type": "http"
        },
        {
          "name": "ANY /-/ready",
          "name_key": "HTTP ANY /-/ready",
          "input": "Prometheus compatibility probe",
          "output": "VictoriaMetrics is Ready",
          "path": "/-/ready",
          "type": "http"
        },
        {
          "name": "ANY /robots.txt",
          "name_key": "HTTP ANY /robots.txt",
          "input": "robots request",
          "output": "search-engine disallow response",
          "path": "/robots.txt",
          "type": "http"
        },
        {
          "name": "ANY /favicon.ico",
          "name_key": "HTTP ANY /favicon.ico",
          "input": "favicon request",
          "output": "embedded favicon",
          "path": "/favicon.ico",
          "type": "http"
        },
        {
          "name": "ANY /debug/pprof/*",
          "name_key": "HTTP ANY /debug/pprof/*",
          "input": "pprof subpath + optional authKey query arg",
          "output": "pprof profile or debug page",
          "path": "/debug/pprof/*",
          "type": "http"
        }
      ]
    },
    {
      "name": "VMAlertHTTP",
      "type": "http",
      "methods": [
        {
          "name": "ANY /vmalert/static/*",
          "name_key": "HTTP ANY /vmalert/static/*",
          "input": "vmalert static asset request",
          "output": "embedded static asset",
          "path": "/vmalert/static/*",
          "type": "http"
        },
        {
          "name": "GET /",
          "name_key": "HTTP GET /",
          "input": "root request; aliases /vmalert and /vmalert/",
          "output": "vmalert welcome page",
          "path": "/",
          "type": "http"
        },
        {
          "name": "ANY /vmalert/alerts",
          "name_key": "HTTP ANY /vmalert/alerts",
          "input": "UI alerts request",
          "output": "rendered alerts page",
          "path": "/vmalert/alerts",
          "type": "http"
        },
        {
          "name": "ANY /vmalert/alert",
          "name_key": "HTTP ANY /vmalert/alert",
          "input": "alert detail request with group_id and alert_id",
          "output": "rendered alert detail page",
          "path": "/vmalert/alert",
          "type": "http"
        },
        {
          "name": "ANY /vmalert/rule",
          "name_key": "HTTP ANY /vmalert/rule",
          "input": "rule detail request with group_id and rule_id",
          "output": "rendered rule detail page",
          "path": "/vmalert/rule",
          "type": "http"
        },
        {
          "name": "ANY /vmalert/groups",
          "name_key": "HTTP ANY /vmalert/groups",
          "input": "group listing request with optional filters",
          "output": "rendered group list page",
          "path": "/vmalert/groups",
          "type": "http"
        },
        {
          "name": "ANY /vmalert/notifiers",
          "name_key": "HTTP ANY /vmalert/notifiers",
          "input": "notifier listing request",
          "output": "rendered notifier target page",
          "path": "/vmalert/notifiers",
          "type": "http"
        },
        {
          "name": "ANY /rules",
          "name_key": "HTTP ANY /rules",
          "input": "Grafana rule page request",
          "output": "rendered group list page",
          "path": "/rules",
          "type": "http"
        },
        {
          "name": "ANY /api/v1/notifiers",
          "name_key": "HTTP ANY /api/v1/notifiers",
          "input": "notifier API request; alias /vmalert/api/v1/notifiers",
          "output": "notifier targets JSON",
          "path": "/api/v1/notifiers",
          "type": "http"
        },
        {
          "name": "ANY /api/v1/rules",
          "name_key": "HTTP ANY /api/v1/rules",
          "input": "rules API request; alias /vmalert/api/v1/rules",
          "output": "rules JSON",
          "path": "/api/v1/rules",
          "type": "http"
        },
        {
          "name": "ANY /api/v1/alerts",
          "name_key": "HTTP ANY /api/v1/alerts",
          "input": "alerts API request; alias /vmalert/api/v1/alerts",
          "output": "alerts JSON",
          "path": "/api/v1/alerts",
          "type": "http"
        },
        {
          "name": "ANY /api/v1/alert",
          "name_key": "HTTP ANY /api/v1/alert",
          "input": "single alert API request with group_id and alert_id; alias /vmalert/api/v1/alert",
          "output": "alert JSON",
          "path": "/api/v1/alert",
          "type": "http"
        },
        {
          "name": "ANY /api/v1/rule",
          "name_key": "HTTP ANY /api/v1/rule",
          "input": "single rule API request with group_id and rule_id; alias /vmalert/api/v1/rule",
          "output": "rule JSON with state updates",
          "path": "/api/v1/rule",
          "type": "http"
        },
        {
          "name": "ANY /-/reload",
          "name_key": "HTTP ANY /-/reload",
          "input": "reload request + optional authKey query arg",
          "output": "local config reload trigger",
          "path": "/-/reload",
          "type": "http"
        }
      ]
    }
  ],
  "extensions": {}
}
