src/Dashboard/Orleans.Dashboard/README.md
Microsoft Orleans Dashboard is a web-based monitoring and diagnostics tool for Orleans applications. It provides real-time visualization of grain activations, runtime statistics, silo health, and performance metrics through an intuitive web interface.
To use this package, install it via NuGet:
dotnet add package Microsoft.Orleans.Dashboard
using Orleans.Dashboard;
var builder = WebApplication.CreateBuilder(args);
// Configure Orleans
builder.UseOrleans(siloBuilder =>
{
siloBuilder.UseLocalhostClustering();
siloBuilder.UseInMemoryReminderService();
siloBuilder.AddMemoryGrainStorageAsDefault();
// Add the dashboard
siloBuilder.AddDashboard();
});
var app = builder.Build();
// Map dashboard endpoints
app.MapOrleansDashboard();
app.Run();
The dashboard will be accessible at the application's base URL (e.g., http://localhost:5000/).
For scenarios where you want to host the dashboard separately from your silos:
using Orleans.Dashboard;
using System.Net;
var builder = WebApplication.CreateBuilder(args);
// Configure Orleans client
builder.UseOrleansClient(clientBuilder =>
{
clientBuilder.UseStaticClustering(options =>
options.Gateways.Add(new IPEndPoint(IPAddress.Loopback, 30000).ToGatewayUri()));
// Add dashboard services
clientBuilder.AddDashboard();
});
var app = builder.Build();
// Map dashboard endpoints
app.MapOrleansDashboard();
await app.RunAsync();
The dashboard can be configured with various options:
siloBuilder.AddDashboard(options =>
{
options.CounterUpdateIntervalMs = 1000; // Metrics update interval (default: 1000ms)
});
You can customize the route prefix when mapping dashboard endpoints:
// Map dashboard at a custom path
app.MapOrleansDashboard(routePrefix: "/dashboard");
// Add authentication
app.MapOrleansDashboard().RequireAuthorization();
Once configured, the dashboard is accessible at:
http://localhost:{AppPort}/ (where AppPort is your web application's port)http://localhost:{AppPort}/{routePrefix}/For complete working examples, see the playground projects:
playground/DashboardCohosted - Dashboard cohosted with Orleans in a web applicationplayground/DashboardSeparateHost - Dashboard in a separate web application connecting to an Orleans clusterFor more comprehensive documentation, please refer to: