Skip to content

Dashboard

GrydJobs includes an embedded monitoring dashboard powered by Hangfire Dashboard.

Setup

csharp
var app = builder.Build();

app.UseGrydJobs();
app.UseGrydJobsDashboard(); // Default path: /grydjobs/dashboard

Custom Path

csharp
app.UseGrydJobsDashboard(pathMatch: "/admin/jobs");

Authentication

The dashboard is protected by ASP.NET Core authentication. Only authenticated users can access it.

The GrydJobsDashboardAuthFilter checks HttpContext.User.Identity.IsAuthenticated before allowing access.

Custom Authorization

To implement more granular authorization (e.g., require admin role), create a custom filter:

csharp
using Hangfire.Dashboard;

public class AdminOnlyDashboardFilter : IDashboardAuthorizationFilter
{
    public bool Authorize(DashboardContext context)
    {
        var httpContext = context.GetHttpContext();
        return httpContext.User.IsInRole("Admin");
    }
}

Then configure it:

csharp
// Override the default dashboard setup
app.UseHangfireDashboard("/grydjobs/dashboard", new DashboardOptions
{
    Authorization = [new AdminOnlyDashboardFilter()],
    DashboardTitle = "GrydJobs Dashboard"
});

Features

The dashboard provides:

  • Real-time monitoring — Live view of job processing stats
  • Queue management — View queue depths and throughput
  • Job inspection — View job details, parameters, and exception info
  • Recurring jobs — List of registered cron jobs with next/last execution
  • Failed jobs — Inspect and retry failed jobs from the UI
  • Server list — View active Hangfire servers and their heartbeats
  • Automatic refresh — Stats polling every 5 seconds

Released under the MIT License.