{
  "manifest_version": "1.0.0",
  "template": {
    "id": "03513e45-4f39-4d74-bf9f-96e601d7c1d8",
    "slug": "pyroscope-profiling",
    "name": "Pyroscope profiling",
    "description": "Protected continuous profiling with durable Pyroscope storage.",
    "url": "https://railway.com/deploy/pyroscope-profiling",
    "upstream": {
      "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
    }
  },
  "services": [
    {
      "name": "Pyroscope",
      "source": {
        "image": "grafana/pyroscope:2.0.2@sha256:644515bfa06cb3779b8666514b1bab2295bd11f1e1a53834bd9584a43f77c4f5"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Pyroscope Gateway",
      "source": {
        "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Pyroscope",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "4040"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "Pyroscope",
      "description": "Railway runtime UID required for its root-owned persistent volume.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "PORT",
      "service": "Pyroscope Gateway",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "UPSTREAM",
      "service": "Pyroscope Gateway",
      "description": "Provide a value for UPSTREAM.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "GATEWAY_CONFIG",
      "service": "Pyroscope Gateway",
      "description": "Provide a value for GATEWAY_CONFIG.",
      "secret": false,
      "strategy": "default",
      "default": ":8080 {\n  handle /healthz {\n    rewrite * /ready\n    reverse_proxy http://__UPSTREAM__\n  }\n  @protected not path /healthz\n  basic_auth @protected {\n    __USERNAME__ __PASSWORD_HASH__\n  }\n  handle {\n    reverse_proxy http://__UPSTREAM__ {\n      header_up -Authorization\n    }\n  }\n}"
    },
    {
      "key": "GATEWAY_PASSWORD",
      "service": "Pyroscope Gateway",
      "description": "Generated profile UI and ingestion password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "GATEWAY_USERNAME",
      "service": "Pyroscope Gateway",
      "description": "Profile UI and ingestion username.",
      "secret": false,
      "strategy": "default",
      "default": "pyroscope"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "pyroscope-profiling"
      }
    },
    "cli": "railway deploy --template pyroscope-profiling",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "03513e45-4f39-4d74-bf9f-96e601d7c1d8",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0794883d-01e4-4a0d-8290-ce44ffceca89": {
                  "icon": null,
                  "name": "Pyroscope",
                  "deploy": {
                    "startCommand": "/usr/bin/pyroscope -config.file=/etc/pyroscope/config.yaml -pyroscopedb.data-path=/data -compactor.data-dir=/data/compactor -metastore.data-dir=/data/metastore/data -metastore.raft.dir=/data/metastore/raft -metastore.raft.snapshots-dir=/data/metastore/snapshots -embedded-grafana.data-path=/data/grafana -pyroscopedb.retention-policy-min-free-disk-gb=1 -retention-period=14d -self-profiling.disable-push=true",
                    "healthcheckPath": "/ready",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "grafana/pyroscope:2.0.2@sha256:644515bfa06cb3779b8666514b1bab2295bd11f1e1a53834bd9584a43f77c4f5"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "4040"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Railway runtime UID required for its root-owned persistent volume.",
                      "defaultValue": "0"
                    }
                  },
                  "volumeMounts": {
                    "0794883d-01e4-4a0d-8290-ce44ffceca89": {
                      "sizeMB": 5000,
                      "mountPath": "/data"
                    }
                  }
                },
                "252e6b64-26b7-4db4-b322-b78ce8bd9e5e": {
                  "icon": null,
                  "name": "Pyroscope Gateway",
                  "deploy": {
                    "startCommand": "/bin/sh -ec 'password_hash=\"$(caddy hash-password --plaintext \"$GATEWAY_PASSWORD\")\"; printf \"%s\\n\" \"$GATEWAY_CONFIG\" | sed -e \"s|__USERNAME__|$GATEWAY_USERNAME|g\" -e \"s|__PASSWORD_HASH__|$password_hash|g\" -e \"s|__UPSTREAM__|$UPSTREAM|g\" >/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": "",
                      "defaultValue": "8080"
                    },
                    "UPSTREAM": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{Pyroscope.RAILWAY_PRIVATE_DOMAIN}}:4040"
                    },
                    "GATEWAY_CONFIG": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": ":8080 {\n  handle /healthz {\n    rewrite * /ready\n    reverse_proxy http://__UPSTREAM__\n  }\n  @protected not path /healthz\n  basic_auth @protected {\n    __USERNAME__ __PASSWORD_HASH__\n  }\n  handle {\n    reverse_proxy http://__UPSTREAM__ {\n      header_up -Authorization\n    }\n  }\n}"
                    },
                    "GATEWAY_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated profile UI and ingestion password.",
                      "defaultValue": "{{GATEWAY_PASSWORD}}"
                    },
                    "GATEWAY_USERNAME": {
                      "isOptional": false,
                      "description": "Profile UI and ingestion username.",
                      "defaultValue": "pyroscope"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Pyroscope Gateway",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-05T00:29:29.762Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_4950fe781a284f37bf45",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 223,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "Pyroscope Gateway"
  }
}
