Skip to content

Commit

Permalink
Merge branch 'main' into prom
Browse files Browse the repository at this point in the history
  • Loading branch information
gitkvark authored Dec 26, 2023
2 parents fc8a52b + d5b52dd commit 7bce093
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 5 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from fastapi import FastAPI

from app.db import database, User

from prometheus_fastapi_instrumentator import Instrumentator

app = FastAPI(title="FastAPI, Docker, and Traefik")
instrumentator = Instrumentator().instrument(app)


@app.get("/")
Expand All @@ -13,6 +14,9 @@ async def read_root():

@app.on_event("startup")
async def startup():
# Expose prometheus metrics using the Instrumentator
# https://github.com/trallnag/prometheus-fastapi-instrumentator
instrumentator.expose(app)
if not database.is_connected:
await database.connect()
# create a dummy entry
Expand Down
16 changes: 6 additions & 10 deletions app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#asyncpg==0.27.0
#fastapi==0.89.1
#ormar==0.12.1
#psycopg2-binary==2.9.5
#uvicorn==0.20.0
asyncpg
fastapi
ormar
psycopg2-binary
uvicorn
asyncpg==0.29.0
fastapi==0.106.0
ormar==0.12.2
psycopg2-binary==2.9.9
uvicorn==0.25.0
prometheus-fastapi-instrumentator==6.1.0

0 comments on commit 7bce093

Please sign in to comment.