使用 Aspire Dashboard 独立版
发布: (2026年4月30日 GMT+8 22:30)
2 分钟阅读
原文: Dev.to
Source: Dev.to
Quick Tip originally published on lukaswalter.dev.
Overview
Aspire 常被视为完整的编排套件,但其 Dashboard 可以 独立运行。
将其用作轻量级、兼容 OTLP 的日志、追踪和指标查看器,支持任何语言(C#、Go、Python 等),无需完整套件的额外开销。
Running the Dashboard
docker run --rm -it \
-p 18888:18888 \
-p 4317:18889 \
-p 4318:18890 \
--name aspire-dashboard \
mcr.microsoft.com/dotnet/aspire-dashboard:latestPorts
| Port | Purpose |
|---|---|
| 18888 | Dashboard UI |
| 4317 | OTLP/gRPC ingestion |
| 4318 | OTLP/HTTP ingestion |
Authentication
Dashboard 默认已启用安全保护。启动容器后,它会在控制台打印登录 URL。使用以下命令获取:
docker logs YOUR-CONTAINER-NAME查找类似以下的行:
Login to the dashboard at http://0.0.0.0:18888/login?t=YOUR_TOKEN_HEREInstant Setup
- 将你的 OpenTelemetry 导出器设置为
http://localhost:4317(或使用 HTTP 时设为http://localhost:4318),Dashboard 将立即开始接收数据。
Key Benefits
- Polyglot – 支持任何兼容 OTLP 的应用程序,不仅限于 .NET。
- Local‑First – 适合开发的“内部循环”,无需额外基础设施。
- Standalone – 提供美观的实时 UI,无需完整的 Aspire 编排堆栈。