File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 44
55
66def get_app () -> FastAPI :
7+ """Setup the Fast API server.
8+
9+ RETURNS (FastAPI): The FastAPI object to start the server.
10+ """
711 app = FastAPI (
812 title = settings .PROJECT_NAME ,
913 version = settings .APP_VERSION ,
@@ -19,9 +23,11 @@ def get_app() -> FastAPI:
1923
2024@app .on_event ("startup" )
2125async def startup_event ():
26+ """Gracefully start the application before the server reports readiness."""
2227 pass
2328
2429
2530@app .on_event ("shutdown" )
2631async def shutdown_event ():
32+ """Gracefully close connections before shutdown of the server."""
2733 pass
Original file line number Diff line number Diff line change 22from logging import Logger
33
44from fastapp .core .config import settings
5+ from opencensus .extension .azure .functions import OpenCensusExtension
6+ from opencensus .trace import config_integration
7+
8+ config_integration .trace_integrations (["requests" ])
9+ OpenCensusExtension .configure ()
510
611
712def setup_logging (module ) -> Logger :
Original file line number Diff line number Diff line change 55azure-functions ~= 1.14.0
66fastapi ~= 0.96.1
77aiohttp ~= 3.8.4
8+ opencensus-extension-azure-functions ~= 1.0.0
9+ opencensus-ext-requests ~= 0.8.0
You can’t perform that action at this time.
0 commit comments