Deploy Your Second App
Deploy a FastAPI app with zero-config source builds and route-level metrics in Studio.
This guide walks you through deploying a two-service FastAPI stack from the howl-cloud/awesome-hostess examples repo. You'll use zero-config source: builds (no Dockerfile required) and the hostess-python SDK to unlock per-route metrics in Studio.
This guide assumes you have the Hostess CLI installed and are logged in. If not, follow Deploy Your First App first.
What You'll Deploy
- api — KickOff Sports product catalog: products, categories, and orders endpoints, instrumented with
hostess-pythonfor route-level metrics and traces - traffic — HTTP service that sends synthetic requests to
api, so you have real data to look at in the Metrics tab
Clone the example
git clone https://github.com/howl-cloud/awesome-hostess.git
cd awesome-hostess/simple-fastapi-appReview the hostess.yml
version: "1.0"
name: simple-fastapi-app
services:
api:
type: fastapi
source: ./api
public: true
resources: small
traffic:
type: fastapi
source: ./traffic
public: true
env:
API_URL: ${api.url}
depends_on:
- api
resources: smallA few things to notice:
source:instead ofbuild:— Hostess auto-detects the language and framework from the directory and builds the image without a Dockerfile. It detectspyproject.toml, installs dependencies withuv, and figures out how to start the app.public: trueon both services — both get a public HTTPS URL.${api.url}— the internal URL ofapiis injected intotrafficat deploy time. The traffic service uses it to know where to send requests.
Review the instrumentation
The api service adds one line to instrument the FastAPI app with hostess-python:
from fastapi import FastAPI
from hostess_sdk.fastapi import instrument
app = FastAPI(title="KickOff Sports API", version="1.0.0")
instrument(app)That's it. instrument(app) wires up OpenTelemetry FastAPI instrumentation and exports spans to the Hostess collector. On each service's Metrics tab in Studio, this unlocks per-route traffic, latency, and status-code breakdowns — and sampled distributed traces you can open as a waterfall.
Validate and deploy
hostess validate✓ hostess.yml is valid
2 services: api, traffichostess deployNo project found. Create one?
Project name: simple-fastapi-app
✓ Project "simple-fastapi-app" created
Environment: preview
api → Installing
traffic → Installing
api ✓ built
traffic ✓ built
✓ Deployment complete (dep_def456)
api: https://simple-fastapi-app-api-k7xm9p2q.hostess.run
traffic: https://simple-fastapi-app-traffic-m3n8x5w2.hostess.runBoth services build in parallel. The CLI streams live phase labels as each image is built and pushed.
Browse the API
FastAPI generates interactive documentation at /docs. Open the api URL from the deploy output with /docs appended:
https://simple-fastapi-app-api-k7xm9p2q.hostess.run/docsYou'll see all available endpoints — products, categories, and orders — and can try them directly from the browser.
Generate traffic
The traffic service exposes a GET /run endpoint that fires a burst of requests at the api. Visit the URL from the deploy output:
curl https://simple-fastapi-app-traffic-m3n8x5w2.hostess.run/run{"sent": 20, "ok": 18, "errors": 2}The count query parameter controls how many requests to send:
curl "https://simple-fastapi-app-traffic-m3n8x5w2.hostess.run/run?count=100"Run it a few times to build up enough data to see in Studio.
View metrics in Studio
Open hostess.sh and navigate to your simple-fastapi-app project. Select the deployment, then click the api service and open the Metrics tab.
You'll see:
- Request rate and latency per route (e.g.
GET /products,GET /products/{product_id},POST /orders) - Status code breakdown — including the intentional 404s the traffic service sends to
/products/99 - Traces — click any route row to open sampled traces as a span waterfall
What's Next
- Next.js + FastAPI + Postgres — Add a frontend and database to your API
- Managing Secrets — Store API keys and credentials securely
- Custom Domains — Point your own domain at your services
- Insights — Learn what the Metrics tab shows and how sampling works