The .NET Aspire dashboard provides a great UI for viewing telemetry. The dashboard:
The dashboard is started using the Docker command line.
docker run --rm -it -d \
-p 18888:18888 \
-p 4317:18889 \
--name aspire-dashboard \
mcr.microsoft.com/dotnet/aspire-dashboard:latest
docker run --rm -it -d `
-p 18888:18888 `
-p 4317:18889 `
--name aspire-dashboard `
mcr.microsoft.com/dotnet/aspire-dashboard:latest
The preceding Docker command:
mcr.microsoft.com/dotnet/aspire-dashboard:9.4
image.18889
to the host's port 4317
. Port 4317
receives OpenTelemetry data from apps. Apps send data using OpenTelemetry Protocol (OTLP).18888
to the host's port 18888
. Port 18888
has the dashboard UI. Navigate to http://localhost:18888
in the browser to view the dashboard.Data displayed in the dashboard can be sensitive. By default, the dashboard is secured with authentication that requires a token to login.
When the dashboard is run from a standalone container, the login token is printed to the container logs. The logs are displayed in the Docker Desktop user interface on the Logs tab for the aspire-dashboard container:
After copying the highlighted token into the login page, select the Login button.
Alternatively, you can obtain the token from the logs by using the docker
command:
#!/bin/bash
loginLine=$(docker container logs aspire-dashboard | grep "login?t=")
match=$(echo "$loginLine" | sed -n 's/.*login?t=\([^[:space:]]*\).*/\1/p')
echo -n "$match" | xclip -selection clipboard
echo "$match"
Note
This script requires that your system has the sed
and xclip
tools installed.
$loginLine = docker container logs aspire-dashboard | Select-String "login\?t="
$matches = [regex]::Match($loginLine, "(?<=login\?t=)(\S+)")
$matches.Value | Set-Clipboard
echo $matches.Value
Tip
To avoid the login, you can disable the authentication requirement by setting the ASPIRE_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS
environment variable to true
. Additional configuration is available, see Dashboard configuration.
For more information about logging into the dashboard, see Dashboard authentication.
Explore the dashboardThe dashboard offers a UI for viewing telemetry. Refer to the documentation to explore the telemetry functionality:
Although there is no restriction on where the dashboard is run, the dashboard is designed as a development and short-term diagnostic tool. The dashboard persists telemetry in-memory which creates some limitations:
The dashboard has functionality for viewing .NET Aspire resources. The dashboard resource features are disabled when it is run in standalone mode. To enable the resources UI, add configuration for a resource service.
GitHub Copilot functionality isn't available in the standalone dashboard. Copilot uses a connection to your IDE to communicate with GitHub Copilot and that connection isn't available when the dashboard is in standalone mode.
Send telemetry to the dashboardApps send telemetry to the dashboard using OpenTelemetry Protocol (OTLP). The dashboard must expose a port for receiving OpenTelemetry data, and apps are configured to send data to that address.
A Docker command was shown earlier to start the dashboard. It configured the container to receive OpenTelemetry data on port 4317
. The OTLP endpoint's full address is http://localhost:4317
.
Apps collect and send telemetry using their language's OpenTelemetry SDK.
Important OpenTelemetry SDK options to configure:
http://localhost:4317
.grpc
protocol.To configure applications:
OTEL_EXPORTER_OTLP_PROTOCOL
with a value of grpc
.OTEL_EXPORTER_OTLP_ENDPOINT
with a value of http://localhost:4317
.For a sample of using the standalone dashboard, see the Standalone .NET Aspire dashboard sample app.
Next stepsConfigure the .NET Aspire dashboard
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4