Dashboard Functionality in 10 #9886
|
In the v8 versioning we had the ability to point the Dashboard from a custom Port to allow us to enable/disable the dashboard being hosted; but it appears in v10 that is lost. It would be great to see those properties exposed again. My Controller project had 2 web-interfaces; 1) the Orleans Dashboard that let me monitor the state of the grid and 2) my own web-ui controller to allow me to monitor the data being processed and state of those processes. Is there a way to host the Dashboard like this again? |
Replies: 2 comments 3 replies
|
Hi @dewrightca, if the goal is to enable/disable the dashboard, could you put a guard around the app.MapWhen(context => context.Connection.LocalPort == 8080, app =>
{
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapOrleansDashboard();
});
});
// and similar for your non-dashboard endpointsYou can also map the dashboard to a custom prefix. |
|
In v10 the dashboard isn’t baked into the silo host any more - you have to pull in the var builder = WebApplication.CreateBuilder(args);
// your usual Orleans config …
builder.Host.UseOrleans(silo => { /* … */ });
if (builder.Configuration.GetValue<bool>("Dashboard:Enabled"))
{
// pulls in the dashboard middleware
builder.Services.AddOrleansDashboard(options =>
{
options.Port = builder.Configuration.GetValue<int>("Dashboard:Port"); // e.g. 8080
// any other options you need
});
}
var app = builder.Build();
if (builder.Configuration.GetValue<bool>("Dashboard:Enabled"))
{ |
In v10 the dashboard isn’t baked into the silo host any more - you have to pull in the
Microsoft.OrleansDashboardpackage and wire it yourself. The easiest way to get the same enable/disable‑by‑port behaviour is to register the dashboard conditionally inProgram.cs(or wherever you build the host) and use theDashboardOptionsto set the port.