Skip to content

Commit 5de99a3

Browse files
authored
Added insights dashboard (Azure-Samples#898)
* Added dashboard * Fix RG scope * Rm redundant parameter
1 parent 7d5da83 commit 5de99a3

File tree

6 files changed

+419
-10
lines changed

6 files changed

+419
-10
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ To inspect the performance of chat requests, use the "Drill into Samples" button
252252

253253
To see any exceptions and server errors, navigate to the "Investigate -> Failures" blade and use the filtering tools to locate a specific exception. You can see Python stack traces on the right-hand side.
254254

255+
You can also see chart summaries on a dashboard by running the following command:
256+
257+
```shell
258+
azd monitor
259+
```
260+
255261
### Enabling authentication
256262

257263
By default, the deployed Azure web app will have no authentication or access restrictions enabled, meaning anyone with routable network access to the web app can chat with your indexed data. You can require authentication to your Azure Active Directory by following the [Add app authentication](https://learn.microsoft.com/azure/app-service/scenario-secure-app-authentication-app-service) tutorial and set it up against the deployed web app.

app/backend/app.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,15 @@ async def setup_clients():
298298

299299

300300
def create_app():
301+
app = Quart(__name__)
302+
app.register_blueprint(bp)
303+
301304
if os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING"):
302305
configure_azure_monitor()
306+
# This tracks HTTP requests made by aiohttp:
303307
AioHttpClientInstrumentor().instrument()
304-
app = Quart(__name__)
305-
app.register_blueprint(bp)
306-
app.asgi_app = OpenTelemetryMiddleware(app.asgi_app) # type: ignore[method-assign]
308+
# This middleware tracks app route requests:
309+
app.asgi_app = OpenTelemetryMiddleware(app.asgi_app) # type: ignore[method-assign]
307310

308311
# Level should be one of https://docs.python.org/3/library/logging.html#logging-levels
309312
default_level = "INFO" # In development, log more verbosely

0 commit comments

Comments
 (0)