{
  "manifest_version": "1.0.0",
  "template": {
    "id": "40e6c813-de35-4183-90d5-2f3dc7b6ad3b",
    "slug": "victoriametrics-observability",
    "name": "VictoriaMetrics observability",
    "description": "Private VictoriaMetrics and Grafana with protected metrics ingestion.",
    "url": "https://railway.com/deploy/victoriametrics-observability",
    "upstream": {
      "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
    }
  },
  "services": [
    {
      "name": "VictoriaMetrics",
      "source": {
        "image": "victoriametrics/victoria-metrics:v1.148.0@sha256:407013e902f9a0ba1d4b2d4c077c47bbaf917c893c52ff39b19efe83a654afda"
      },
      "needs_volume": true,
      "volume_mount_path": "/victoria-metrics-data",
      "http": false
    },
    {
      "name": "VictoriaMetrics Gateway",
      "source": {
        "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "VictoriaMetrics Grafana",
      "source": {
        "image": "grafana/grafana:13.1.1@sha256:7cb8c64c4d57a57e734073f3cc94620adb24a0acb929bd80ba9f14017e3a975b"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/grafana",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "VictoriaMetrics",
      "description": "Private VictoriaMetrics HTTP port.",
      "secret": false,
      "strategy": "default",
      "default": "8428"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "VictoriaMetrics",
      "description": "Grace period for flushing pending writes during replacement.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    },
    {
      "key": "PORT",
      "service": "VictoriaMetrics Gateway",
      "description": "Public gateway port.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "GRAFANA_UPSTREAM",
      "service": "VictoriaMetrics Gateway",
      "description": "Private Grafana origin.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "VICTORIAMETRICS_UPSTREAM",
      "service": "VictoriaMetrics Gateway",
      "description": "Private VictoriaMetrics origin.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "VICTORIAMETRICS_READ_TOKEN",
      "service": "VictoriaMetrics Gateway",
      "description": "Generated bearer token for query endpoints.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "VICTORIAMETRICS_WRITE_TOKEN",
      "service": "VictoriaMetrics Gateway",
      "description": "Generated bearer token for ingestion endpoints.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PORT",
      "service": "VictoriaMetrics Grafana",
      "description": "Private Grafana HTTP port.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "VictoriaMetrics Grafana",
      "description": "Bootstraps volume ownership as root before dropping to Grafana UID 472.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "GF_SERVER_HTTP_PORT",
      "service": "VictoriaMetrics Grafana",
      "description": "Grafana listener port.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "VICTORIAMETRICS_URL",
      "service": "VictoriaMetrics Grafana",
      "description": "Private data-source URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "GF_SECURITY_ADMIN_USER",
      "service": "VictoriaMetrics Grafana",
      "description": "Initial administrator username.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "GF_SECURITY_SECRET_KEY",
      "service": "VictoriaMetrics Grafana",
      "description": "Stable generated key for Grafana secrets.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "GF_USERS_ALLOW_SIGN_UP",
      "service": "VictoriaMetrics Grafana",
      "description": "Disables public registration.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "GF_AUTH_ANONYMOUS_ENABLED",
      "service": "VictoriaMetrics Grafana",
      "description": "Disables anonymous access.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "GRAFANA_DATASOURCE_CONFIG",
      "service": "VictoriaMetrics Grafana",
      "description": "Pinned provisioning document.",
      "secret": false,
      "strategy": "default",
      "default": "apiVersion: 1\ndatasources:\n  - name: VictoriaMetrics\n    uid: victoriametrics\n    type: prometheus\n    access: proxy\n    url: __VICTORIAMETRICS_URL__\n    isDefault: true\n    editable: false\n    jsonData:\n      httpMethod: POST"
    },
    {
      "key": "GF_SECURITY_ADMIN_PASSWORD",
      "service": "VictoriaMetrics Grafana",
      "description": "Generated initial administrator password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "GF_ANALYTICS_CHECK_FOR_UPDATES",
      "service": "VictoriaMetrics Grafana",
      "description": "Disables update checks.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "GF_ANALYTICS_REPORTING_ENABLED",
      "service": "VictoriaMetrics Grafana",
      "description": "Disables usage reporting.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "GF_PLUGINS_PREINSTALL_DISABLED",
      "service": "VictoriaMetrics Grafana",
      "description": "Disables unrelated automatic plugin downloads.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "GF_PLUGINS_PREINSTALL_AUTO_UPDATE",
      "service": "VictoriaMetrics Grafana",
      "description": "Disables automatic plugin updates.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "VictoriaMetrics Grafana",
      "description": "Grace period for stateful replacement.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "victoriametrics-observability"
      }
    },
    "cli": "railway deploy --template victoriametrics-observability",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "40e6c813-de35-4183-90d5-2f3dc7b6ad3b",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "03cb346f-a461-41a1-8548-66d8eb1a8f1f": {
                  "icon": null,
                  "name": "VictoriaMetrics",
                  "deploy": {
                    "startCommand": "/victoria-metrics-prod -storageDataPath=/victoria-metrics-data -retentionPeriod=30d -httpListenAddr=:8428 -selfScrapeInterval=10s",
                    "healthcheckPath": "/-/ready",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 180,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "victoriametrics/victoria-metrics:v1.148.0@sha256:407013e902f9a0ba1d4b2d4c077c47bbaf917c893c52ff39b19efe83a654afda"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Private VictoriaMetrics HTTP port.",
                      "defaultValue": "8428"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period for flushing pending writes during replacement.",
                      "defaultValue": "30"
                    }
                  },
                  "volumeMounts": {
                    "03cb346f-a461-41a1-8548-66d8eb1a8f1f": {
                      "sizeMB": 5000,
                      "mountPath": "/victoria-metrics-data"
                    }
                  }
                },
                "398d81d9-86fe-4986-a61c-a6b8c460bcf8": {
                  "icon": null,
                  "name": "VictoriaMetrics Gateway",
                  "deploy": {
                    "startCommand": "/bin/sh -ec 'printf '\"'\"':8080 {\\n handle /healthz {\\n  rewrite * /api/health\\n  reverse_proxy %s\\n }\\n @write path /api/v1/write /api/v1/import/prometheus /opentelemetry/v1/metrics\\n handle @write {\\n  @unauthorized not header Authorization \"Bearer %s\"\\n  respond @unauthorized 401\\n  reverse_proxy %s\\n }\\n @read path /api/v1/query /api/v1/query_range\\n handle @read {\\n  @unauthorized not header Authorization \"Bearer %s\"\\n  respond @unauthorized 401\\n  reverse_proxy %s\\n }\\n handle {\\n  reverse_proxy %s\\n }\\n}\\n'\"'\"' \"$GRAFANA_UPSTREAM\" \"$VICTORIAMETRICS_WRITE_TOKEN\" \"$VICTORIAMETRICS_UPSTREAM\" \"$VICTORIAMETRICS_READ_TOKEN\" \"$VICTORIAMETRICS_UPSTREAM\" \"$GRAFANA_UPSTREAM\" >/tmp/Caddyfile; exec caddy run --config /tmp/Caddyfile --adapter caddyfile'",
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Public gateway port.",
                      "defaultValue": "8080"
                    },
                    "GRAFANA_UPSTREAM": {
                      "isOptional": false,
                      "description": "Private Grafana origin.",
                      "defaultValue": "http://${{VictoriaMetrics Grafana.RAILWAY_PRIVATE_DOMAIN}}:3000"
                    },
                    "VICTORIAMETRICS_UPSTREAM": {
                      "isOptional": false,
                      "description": "Private VictoriaMetrics origin.",
                      "defaultValue": "http://${{VictoriaMetrics.RAILWAY_PRIVATE_DOMAIN}}:8428"
                    },
                    "VICTORIAMETRICS_READ_TOKEN": {
                      "isOptional": false,
                      "description": "Generated bearer token for query endpoints.",
                      "defaultValue": "{{VICTORIAMETRICS_READ_TOKEN}}"
                    },
                    "VICTORIAMETRICS_WRITE_TOKEN": {
                      "isOptional": false,
                      "description": "Generated bearer token for ingestion endpoints.",
                      "defaultValue": "{{VICTORIAMETRICS_WRITE_TOKEN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 8080
                      }
                    }
                  }
                },
                "b1235abb-bac9-414b-95a2-dce5605d2cce": {
                  "icon": null,
                  "name": "VictoriaMetrics Grafana",
                  "deploy": {
                    "startCommand": "/bin/sh -ec 'printf \"%s\\n\" \"$GRAFANA_DATASOURCE_CONFIG\" | sed \"s|__VICTORIAMETRICS_URL__|$VICTORIAMETRICS_URL|g\" > /etc/grafana/provisioning/datasources/victoriametrics.yaml; chown -R 472:0 /var/lib/grafana; exec su -s /bin/sh grafana -c /run.sh'",
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "grafana/grafana:13.1.1@sha256:7cb8c64c4d57a57e734073f3cc94620adb24a0acb929bd80ba9f14017e3a975b"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Private Grafana HTTP port.",
                      "defaultValue": "3000"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Bootstraps volume ownership as root before dropping to Grafana UID 472.",
                      "defaultValue": "0"
                    },
                    "GF_SERVER_HTTP_PORT": {
                      "isOptional": false,
                      "description": "Grafana listener port.",
                      "defaultValue": "3000"
                    },
                    "VICTORIAMETRICS_URL": {
                      "isOptional": false,
                      "description": "Private data-source URL.",
                      "defaultValue": "http://${{VictoriaMetrics.RAILWAY_PRIVATE_DOMAIN}}:8428/prometheus"
                    },
                    "GF_SECURITY_ADMIN_USER": {
                      "isOptional": false,
                      "description": "Initial administrator username.",
                      "defaultValue": "admin"
                    },
                    "GF_SECURITY_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Stable generated key for Grafana secrets.",
                      "defaultValue": "{{GF_SECURITY_SECRET_KEY}}"
                    },
                    "GF_USERS_ALLOW_SIGN_UP": {
                      "isOptional": false,
                      "description": "Disables public registration.",
                      "defaultValue": "false"
                    },
                    "GF_AUTH_ANONYMOUS_ENABLED": {
                      "isOptional": false,
                      "description": "Disables anonymous access.",
                      "defaultValue": "false"
                    },
                    "GRAFANA_DATASOURCE_CONFIG": {
                      "isOptional": false,
                      "description": "Pinned provisioning document.",
                      "defaultValue": "apiVersion: 1\ndatasources:\n  - name: VictoriaMetrics\n    uid: victoriametrics\n    type: prometheus\n    access: proxy\n    url: __VICTORIAMETRICS_URL__\n    isDefault: true\n    editable: false\n    jsonData:\n      httpMethod: POST"
                    },
                    "GF_SECURITY_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated initial administrator password.",
                      "defaultValue": "{{GF_SECURITY_ADMIN_PASSWORD}}"
                    },
                    "GF_ANALYTICS_CHECK_FOR_UPDATES": {
                      "isOptional": false,
                      "description": "Disables update checks.",
                      "defaultValue": "false"
                    },
                    "GF_ANALYTICS_REPORTING_ENABLED": {
                      "isOptional": false,
                      "description": "Disables usage reporting.",
                      "defaultValue": "false"
                    },
                    "GF_PLUGINS_PREINSTALL_DISABLED": {
                      "isOptional": false,
                      "description": "Disables unrelated automatic plugin downloads.",
                      "defaultValue": "true"
                    },
                    "GF_PLUGINS_PREINSTALL_AUTO_UPDATE": {
                      "isOptional": false,
                      "description": "Disables automatic plugin updates.",
                      "defaultValue": "false"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period for stateful replacement.",
                      "defaultValue": "30"
                    }
                  },
                  "volumeMounts": {
                    "b1235abb-bac9-414b-95a2-dce5605d2cce": {
                      "sizeMB": 5000,
                      "mountPath": "/var/lib/grafana"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "VictoriaMetrics Gateway",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T10:14:45.332Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-07T00:05:56.246Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_71a97a7d6d4c441a8a79",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 193,
    "typical_build_seconds": 0,
    "typical_start_seconds": 12,
    "slowest_service": "VictoriaMetrics Gateway"
  }
}
