İçeriğe geç

Standalone Aspire dashboard

Bu içerik henüz dilinizde mevcut değil.

The Aspire dashboard provides a great UI for viewing telemetry. The dashboard:

  • Ships as a container image that can be used with any OpenTelemetry enabled app.
  • Can be used standalone, without the rest of Aspire.
A screenshot of the Aspire dashboard running in standalone mode.

The dashboard is started using the Docker command line.

Terminal window
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:

  • Starts a container from the mcr.microsoft.com/dotnet/aspire-dashboard:latest image.
  • The container exposes two ports:
    • Mapping the dashboard’s OTLP port 18889 to the host’s port 4317. Port 4317 receives OpenTelemetry data from apps. Apps send data using OpenTelemetry Protocol (OTLP).
    • Mapping the dashboard’s port 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:

Screenshot of the Aspire dashboard container logs.

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:

Terminal window
#!/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"

For more information about logging into the dashboard, see Dashboard authentication.

The 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:

  • Telemetry is automatically removed if telemetry limits are exceeded.
  • No telemetry is persisted when the dashboard is restarted.

The dashboard has functionality for viewing 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.

Apps 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:

  • OTLP endpoint, which should match the dashboard’s configuration, for example, http://localhost:4317.
  • OTLP protocol, with the dashboard currently supporting only the OTLP/gRPC protocol. Configure applications to use the grpc protocol.

To configure applications:

  • Use the OpenTelemetry SDK APIs within the application, or
  • Start the app with known environment variables:
    • 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 Aspire dashboard sample app.

Sor & YanıtlaİşbirliğiToplulukTartışİzle