{
  "repo": "tidbcloud/VictoriaMetrics",
  "binary": "vmagent",
  "binary_path": "app/vmagent/main.go",
  "dependencies": {
    "Runtime VMAgentLifecycle.DryRunPromscrapeConfig": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Only when promscrape.config points to a local file"
          ],
          "operations": [
            {
              "operation": "READ CONFIG",
              "trigger": "Validate the scrape config and exit without starting any runtime services",
              "conditions": [
                "promscrape.IsDryRun() == true",
                "promscrape.config is a local file path"
              ],
              "implementation": "main -> promscrape.CheckConfig() -> loadConfig(promscrapeConfigFile)"
            }
          ]
        }
      },
      "services": []
    },
    "Runtime VMAgentLifecycle.DryRunAllConfigs": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Only when config files are local paths"
          ],
          "operations": [
            {
              "operation": "READ CONFIGS",
              "trigger": "Validate scrape config, remote write relabel config, and stream aggregation config before exiting",
              "conditions": [
                "dryRun == true"
              ],
              "implementation": "main -> promscrape.CheckConfig() + remotewrite.CheckRelabelConfigs() + remotewrite.CheckStreamAggrConfigs()"
            }
          ]
        }
      },
      "services": []
    },
    "Runtime VMAgentLifecycle.StartIngestionRateLimiter": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.InitializeRemoteWrite": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "When remoteWrite.tmpDataPath is used for pending queues"
          ],
          "operations": [
            {
              "operation": "INITIALIZE QUEUES",
              "trigger": "Create remote-write queues, optional persistent storage, relabel config state, and stream aggregation state before accepting metrics",
              "conditions": [
                "len(remoteWrite.url) > 0"
              ],
              "implementation": "main -> remotewrite.Init() -> initRelabelConfigs() + initStreamAggrConfigGlobal() + initRemoteWriteCtxs(remoteWriteURLs) + dropDanglingQueues()"
            }
          ]
        }
      },
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "At least one remoteWrite.url is configured"
          ],
          "operations": [
            {
              "operation": "CONFIGURE DOWNSTREAM WRITERS",
              "trigger": "Build the remote write runtime that every ingest and scrape path will push into",
              "conditions": [
                "remotewrite.Init() succeeds"
              ],
              "implementation": "remotewrite.initRemoteWriteCtxs(remoteWriteURLs) -> create client/queue contexts for every configured URL"
            }
          ]
        }
      ]
    },
    "Runtime VMAgentLifecycle.StartUnmarshalWorkers": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StartInfluxListener": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StartGraphiteListener": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StartOpenTSDBListener": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StartOpenTSDBHTTPListener": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.InitializePromscrape": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Only when promscrape.config points to a local file and is non-empty"
          ],
          "operations": [
            {
              "operation": "READ SCRAPE CONFIG",
              "trigger": "Load scrape config and start scrape/service-discovery runtime",
              "conditions": [
                "promscrape.config != \"\"",
                "promscrape.config is a local file path"
              ],
              "implementation": "main -> promscrape.Init(remotewrite.PushDropSamplesOnFailure) -> runScraper -> loadConfig(promscrapeConfigFile)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "configured-scrape-targets",
          "target_interface": "Prometheus scrape target HTTP endpoints",
          "operation_type": "http_get",
          "conditions": [
            "promscrape.config defines scrape jobs"
          ],
          "operations": [
            {
              "operation": "SCRAPE TARGETS",
              "trigger": "Run scrape loops and service discovery against configured targets",
              "conditions": [
                "promscrape.config != \"\""
              ],
              "implementation": "promscrape.Init -> runScraper -> cfg.mustStart() + newScrapeConfigs(...)"
            }
          ]
        },
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "Scraped data is forwarded through PushDropSamplesOnFailure"
          ],
          "operations": [
            {
              "operation": "FORWARD SCRAPED METRICS",
              "trigger": "Send scraped samples into the remote write pipeline",
              "conditions": [
                "promscrape push callback fires"
              ],
              "implementation": "main -> promscrape.Init(remotewrite.PushDropSamplesOnFailure)"
            }
          ]
        }
      ]
    },
    "Runtime VMAgentLifecycle.StartHTTPServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.InitializePushMetrics": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.WaitForSigterm": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StopIngestionRateLimiter": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StopPushMetrics": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StopHTTPServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StopPromscrape": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StopProtocolListeners": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StopUnmarshalWorkers": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentLifecycle.StopRemoteWrite": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /api/v1/import/prometheus": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The request path is a supported single-tenant Prometheus exposition import path",
            "prometheusimport.InsertHandler(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse Prometheus exposition rows and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "GetTimestamp(req) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> prometheusimport.InsertHandler(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /api/v1/write": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The request path is a supported single-tenant Prometheus remote write alias",
            "HandleVMProtoServerHandshake(w, r) == false",
            "promremotewrite.InsertHandler(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse a single-tenant remote write payload and push it into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> promremotewrite.InsertHandler(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /api/v1/import": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The request path is a supported single-tenant vmimport alias",
            "vmimport.InsertHandler(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse VM JSON import rows and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> vmimport.InsertHandler(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /api/v1/import/csv": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The request path is a supported single-tenant CSV import alias",
            "csvimport.InsertHandler(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse CSV import rows and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> csvimport.InsertHandler(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /api/v1/import/native": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The request path is a supported single-tenant native import alias",
            "native.InsertHandler(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse native blocks and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> native.InsertHandler(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /influx/write": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The request path is a supported single-tenant Influx write alias",
            "influx.InsertHandlerForHTTP(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse single-tenant Influx line protocol and push it into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "stream.Parse(req.Body, encoding, isStreamMode, precision, db, ...) succeeds",
                "remotewrite.TryPush(nil, &ctx.ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> influx.InsertHandlerForHTTP(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP GET /influx/query": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /influx/health": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /opentelemetry/v1/metrics": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The request path is a supported single-tenant OpenTelemetry alias",
            "opentelemetry.InsertHandler(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse OTLP or Firehose payloads and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "Content-Type is protobuf, or JSON plus X-Amz-Firehose-Protocol-Version is present",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> opentelemetry.InsertHandler(nil, r) -> stream.ParseStream -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP GET /newrelic": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /newrelic/inventory/deltas": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /newrelic/infra/v2/metrics/events/bulk": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "newrelic.InsertHandlerForHTTP(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse New Relic metric payloads and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "stream.Parse(req.Body, encoding, ...) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> newrelic.InsertHandlerForHTTP(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /datadog/api/v1/series": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "datadogv1.InsertHandlerForHTTP(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse DataDog v1 series and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "stream.Parse(req.Body, ce, ...) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> datadogv1.InsertHandlerForHTTP(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /datadog/api/v2/series": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "datadogv2.InsertHandlerForHTTP(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse DataDog v2 series and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "stream.Parse(req.Body, ce, ct, ...) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> datadogv2.InsertHandlerForHTTP(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /datadog/api/beta/sketches": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "datadogsketches.InsertHandlerForHTTP(nil, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse DataDog sketches and push summary rows into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "stream.Parse(req.Body, ce, ...) succeeds",
                "remotewrite.TryPush(nil, &ctx.WriteRequest) == true"
              ],
              "implementation": "requestHandler -> datadogsketches.InsertHandlerForHTTP(nil, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(nil, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP GET /datadog/api/v1/validate": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /datadog/api/v1/check_run": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /datadog/intake": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /datadog/api/v1/metadata": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /targets": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /service-discovery": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /metric-relabel-debug": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /target-relabel-debug": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /api/v1/targets": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /target_response": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /config": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "configAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "READ CONFIG SNAPSHOT",
              "trigger": "Expose the last loaded promscrape config contents",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, configAuthKey) == true"
              ],
              "implementation": "requestHandler -> promscrape.WriteConfigData(w)"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP GET /api/v1/status/config": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "configAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "READ CONFIG SNAPSHOT",
              "trigger": "Expose the last loaded promscrape config contents in Prometheus-compatible JSON form",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, configAuthKey) == true"
              ],
              "implementation": "requestHandler -> promscrape.WriteConfigData(&bb)"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP ANY /-/reload": {
      "infrastructure": {
        "local_process": {
          "conditions": [
            "reloadAuthKey auth passes"
          ],
          "operations": [
            {
              "operation": "SELF SIGHUP",
              "trigger": "Trigger config reload for promscrape and remote write reloader chains",
              "conditions": [
                "httpserver.CheckAuthFlag(w, r, reloadAuthKey) == true"
              ],
              "implementation": "requestHandler -> procutil.SelfSIGHUP()"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP GET /ready": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /static/*": {
      "infrastructure": {},
      "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": []
    },
    "HTTP POST /insert/{tenant}/prometheus/api/v1/import/prometheus": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "httpserver.ParsePath(path) succeeds",
            "prefix == insert",
            "auth.NewTokenPossibleMultitenant succeeds",
            "The suffix is a supported multitenant Prometheus exposition import path",
            "prometheusimport.InsertHandler(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified Prometheus exposition rows and push them into the remote write pipeline with tenant labels",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "GetTimestamp(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> prometheusimport.InsertHandler(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/prometheus/api/v1/write": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "httpserver.ParsePath(path) succeeds",
            "prefix == insert",
            "auth.NewTokenPossibleMultitenant succeeds",
            "The suffix is a supported multitenant Prometheus remote write alias",
            "promremotewrite.InsertHandler(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified remote write payload and push it into the remote write pipeline with tenant labels",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> promremotewrite.InsertHandler(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/prometheus/api/v1/import": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is prometheus/api/v1/import",
            "auth.NewTokenPossibleMultitenant succeeds",
            "vmimport.InsertHandler(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified VM JSON import rows and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> vmimport.InsertHandler(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/prometheus/api/v1/import/csv": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is prometheus/api/v1/import/csv",
            "auth.NewTokenPossibleMultitenant succeeds",
            "csvimport.InsertHandler(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified CSV import rows and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> csvimport.InsertHandler(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/prometheus/api/v1/import/native": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is prometheus/api/v1/import/native",
            "auth.NewTokenPossibleMultitenant succeeds",
            "native.InsertHandler(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified native blocks and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> native.InsertHandler(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/influx/write": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is a supported Influx alias",
            "auth.NewTokenPossibleMultitenant succeeds",
            "influx.InsertHandlerForHTTP(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified Influx line protocol and push it into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> influx.InsertHandlerForHTTP(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP GET /insert/{tenant}/influx/query": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /insert/{tenant}/influx/health": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /insert/{tenant}/opentelemetry/v1/metrics": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is a supported OpenTelemetry alias",
            "auth.NewTokenPossibleMultitenant succeeds",
            "opentelemetry.InsertHandler(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified OTLP / Firehose payloads and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> opentelemetry.InsertHandler(at, r) -> stream.ParseStream -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP GET /insert/{tenant}/newrelic": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /insert/{tenant}/newrelic/inventory/deltas": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /insert/{tenant}/newrelic/infra/v2/metrics/events/bulk": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is newrelic/infra/v2/metrics/events/bulk",
            "auth.NewTokenPossibleMultitenant succeeds",
            "newrelic.InsertHandlerForHTTP(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified New Relic metric payloads and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> newrelic.InsertHandlerForHTTP(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/datadog/api/v1/series": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is datadog/api/v1/series",
            "auth.NewTokenPossibleMultitenant succeeds",
            "datadogv1.InsertHandlerForHTTP(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified DataDog v1 series and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> datadogv1.InsertHandlerForHTTP(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/datadog/api/v2/series": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is datadog/api/v2/series",
            "auth.NewTokenPossibleMultitenant succeeds",
            "datadogv2.InsertHandlerForHTTP(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified DataDog v2 series and push them into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> datadogv2.InsertHandlerForHTTP(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/datadog/api/beta/sketches": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "The multitenant suffix is datadog/api/beta/sketches",
            "auth.NewTokenPossibleMultitenant succeeds",
            "datadogsketches.InsertHandlerForHTTP(at, r) returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse tenant-qualified DataDog sketches and push summary rows into the remote write pipeline",
              "conditions": [
                "GetExtraLabels(req) succeeds",
                "remotewrite.TryPush(at, &ctx.WriteRequest) == true"
              ],
              "implementation": "processMultitenantRequest -> datadogsketches.InsertHandlerForHTTP(at, r) -> stream.Parse -> insertRows -> remotewrite.TryPush(at, &ctx.WriteRequest)"
            }
          ]
        }
      ]
    },
    "HTTP GET /insert/{tenant}/datadog/api/v1/validate": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /insert/{tenant}/datadog/api/v1/check_run": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /insert/{tenant}/datadog/intake": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /insert/{tenant}/datadog/api/v1/metadata": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMAgentProtocol.InfluxListener": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "influxListenAddr is non-empty",
            "influx listener accepted a TCP or UDP payload",
            "influx.InsertHandlerForReader(nil, r, \"\") returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse Influx line protocol from the dedicated TCP/UDP listener and push it into the remote write pipeline",
              "conditions": [
                "remotewrite.TryPush(nil, &ctx.ctx.WriteRequest) == true"
              ],
              "implementation": "influxserver.MustStart(..., func(r io.Reader) error { return influx.InsertHandlerForReader(nil, r, \"\") })"
            }
          ]
        }
      ]
    },
    "Runtime VMAgentProtocol.GraphiteListener": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "graphiteListenAddr is non-empty",
            "graphite.InsertHandler returns no error"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse Graphite plaintext metrics from the dedicated TCP/UDP listener and push them into the remote write pipeline",
              "conditions": [
                "graphiteserver.MustStart(..., graphite.InsertHandler) is running"
              ],
              "implementation": "graphiteserver.MustStart(listenAddr, useProxyProtocol, graphite.InsertHandler)"
            }
          ]
        }
      ]
    },
    "Runtime VMAgentProtocol.OpenTSDBListener": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "opentsdbListenAddr is non-empty",
            "OpenTSDB telnet parser or shared HTTP put parser accepts the payload"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse OpenTSDB traffic from the shared TCP/UDP listener and push it into the remote write pipeline",
              "conditions": [
                "opentsdbserver.MustStart(..., opentsdb.InsertHandler, httpInsertHandler) is running"
              ],
              "implementation": "opentsdbserver.MustStart(listenAddr, useProxyProtocol, opentsdb.InsertHandler, getOpenTSDBHTTPInsertHandler())"
            }
          ]
        }
      ]
    },
    "HTTP POST /insert/{tenant}/opentsdb/api/put": {
      "infrastructure": {},
      "services": [
        {
          "name": "configured-remote-write-http",
          "target_interface": "remoteWrite.url endpoint",
          "operation_type": "http_post",
          "conditions": [
            "opentsdbHTTPListenAddr is non-empty",
            "If multitenancy is disabled, the path normalizes to /api/put",
            "If multitenancy is enabled, the path parses as /insert/{tenant}/opentsdb/api/put"
          ],
          "operations": [
            {
              "operation": "QUEUE METRICS",
              "trigger": "Parse OpenTSDB HTTP put requests from the dedicated HTTP listener and push them into the remote write pipeline",
              "conditions": [
                "getOpenTSDBHTTPInsertHandler()(req) returns no error"
              ],
              "implementation": "opentsdbhttpserver.MustStart(listenAddr, useProxyProtocol, getOpenTSDBHTTPInsertHandler())"
            }
          ]
        }
      ]
    }
  },
  "notes": [
    "The fresh mapping keeps vmagent request-driven but method-level: scrape/config/debug routes are local runtime/state access, while ingest routes all converge on remotewrite.TryPush with protocol-specific parsing and tenant conditions.",
    "Single-tenant and multitenant ingest routes share the same downstream queueing logic but differ in how the auth token is derived, so they are modeled as separate method families instead of one collapsed blob."
  ]
}
