• Stars
    star
    709
  • Rank 63,849 (Top 2 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“Š A developer dashboard for Microsoft Orleans

Orleans Dashboard

.NET Core Node CI Nuget

Discuss on Discord


A dashboard for Microsoft Orleans which provides some simple metrics and insights into what is happening inside your Orleans appliction.

The dashboard is simple to set up and is designed as a convenience for developers to use whilst building Orleans applications. It is not designed as a replacement for a production monitoring system.

Installation

Using the Package Manager Console:

dotnet add package OrleansDashboard

Then add with programmatic configuration:

new HostBuilder()
  .UseOrleans(o => o.UseDashboard(options => { })
  .Build();

The dashboard should be installed on every silo in the cluster.

Start the silo, and open this url in your browser: http://localhost:8080

Please note, the dashboard registers its services and grains using ConfigureApplicationParts which disables the automatic discovery of grains in Orleans. To enable automatic discovery of the grains of the original project, change the configuration to:

new HostBuilder()
  .UseOrleans(o => {
    o.ConfigureApplicationParts(parts => parts.AddFromApplicationBaseDirectory());
    o.UseDashboard(options => { });
  })
  .Build();

Self-Hosted Dashboard

In some cases you may wish to disable the dashboard's own web server, and host the dashboard on your own web application.

You can configure to include the dashboard as middleware:

using Microsoft.AspNetCore.Http.Extensions;
using Orleans;
using Orleans.Hosting;

var builder = WebApplication.CreateBuilder();

builder.Host.UseOrleans(siloBuilder =>
{
  siloBuilder.UseLocalhostClustering();
  siloBuilder.UseDashboard(x => x.HostSelf = true);
});

var app = builder.Build();

app.Map("/dashboard", x => x.UseOrleansDashboard());

CPU and Memory Metrics on Windows

The CPU and Memory metrics are only enabled on Windows when you add the Microsoft.Orleans.OrleansTelemetryConsumers.Counters package and have registered an implementation of IHostEnvironmentStatistics such as with builder.UsePerfCounterEnvironmentStatistics() (currently Windows only). You also have to wait some time before you see the data.

CPU and Memory Metrics on Linux

Since version 2.3, Orleans includes an implementation of IHostEnvironmentStatistics for Linux in Microsoft.Orleans.OrleansTelemetryConsumers.Linux. To enable CPU and Memory metrics, install the NuGet package and add the implementation to the silo using siloBuilder.UseLinuxEnvironmentStatistics().

CPU and Memory Metrics on AWS ECS

A community-maintained implementation of IHostEnvironmentStatistics for AWS ECS is available in Orleans.TelemetryConsumers.ECS. To enable CPU and Memory metrics, install the NuGet package and add the implementation to the silo using siloBuilder.UseEcsTaskHostEnvironmentStatistics().

Configuring the Dashboard

The dashboard supports the following properties for the configuration:

  • Username : Set a username for accessing the dashboard (basic auth).
  • Password : Set a password for accessing the dashboard (basic auth).
  • Host : Host name to bind the web server to (default is *).
  • Port : Set the port number for the dashboard to listen on (default is 8080).
  • HostSelf : Set the dashboard to host it's own http server (default is true).
  • CounterUpdateIntervalMs : The update interval in milliseconds between sampling counters (default is 1000).
new HostBuilder()
  .UseOrleans(o => {
    o.UseDashboard(options => {
      options.Username = "USERNAME";
      options.Password = "PASSWORD";
      options.Host = "*";
      options.Port = 8080;
      options.HostSelf = true;
      options.CounterUpdateIntervalMs = 1000;
    })
  })
  .Build();

Note that some users have noticed performance degredation when using the dashboard. In this case it is recommended that you try increasing the CounterUpdateIntervalMS to 10000 to see if that helps.

Using the Dashboard

Once your silos are running, you can connect to any of them using your web browser: http://silo-address:8080/

If you've started the dashboard on an alternative port, you'll need to specify that instead.

The dashboard will also relay trace information over http. You can view this in the dashboard, or from the terminal: curl http://silo-address:8080/Trace

Grain Details

For the state output we use some conventions:

  1. Looks for a parameter less method "GetState". Example: TestStateInMemoryGrain.cs
  2. Looks for methods thats returns types that are declared as IPersistentState property in the concret grain type. Example: TestStateGrain.cs

For Compound Key grains pass the id in format "{id},{additionalKey}", example: 123,testing

Building the UI

This is only required if you want to modify the user interface.

The user interface is react.js, using browserify to compose the javascript delivered to the browser. The HTML and JS files are embedded resources within the dashboard DLL.

To build the UI, you must have node.js and npm installed.

To build index.min.js, which contains the UI components and dependencies, install the dependencies and run the build script using npm:

$ cd App
$ npm install
$ npm run build

This will copy the bundled, minified javascript file into the correct place for it to be picked up as an embedded resource in the .NET OrleansDashboard project.

You will need to rebuild the OrleansDashboard project to see any changes.

Testing the Dashboard

The Tests/TestHosts/ directory contains a number of preconfigured test application.

Try the Tests/TestHosts/TestHost project as a starting point.

Dashboard API

The dashboard exposes an HTTP API you can consume yourself.

DashboardCounters

GET /DashboardCounters

Returns a summary of cluster metrics. Number of active hosts (and a history), number of activations (and a history), summary of the active grains and active hosts.

{
  "totalActiveHostCount": 3,
  "totalActiveHostCountHistory": [ ... ],
  "hosts": [ ... ],
  "simpleGrainStats": [ ... ],
  "totalActivationCount": 32,
  "totalActivationCountHistory": [ ... ]
}

Historical Stats

GET /HistoricalStats/{siloAddress}

Returns last 100 samples of a silo's stats.

[
  {
    "activationCount": 175,
    "recentlyUsedActivationCount": 173,
    "requestQueueLength": 0,
    "sendQueueLength": 0,
    "receiveQueueLength": 0,
    "cpuUsage": 88.216095,
    "availableMemory": 5097017340,
    "memoryUsage": 46837756,
    "totalPhysicalMemory": 17179869184,
    "isOverloaded": false,
    "clientCount": 1,
    "receivedMessages": 8115,
    "sentMessages": 8114,
    "dateTime": "2017-07-05T11:58:11.39491Z"
  },
  ...
]

Silo Properties

GET /SiloProperties/{address}

Returns properties captured for the given Silo. At the moment this is just the Orleans version.

{
  "OrleansVersion": "1.5.0.0"
}

Grain Stats

GET /GrainStats/{grainName}

Returns the grain method profiling counters collected over the last 100 seconds for each grain, aggregated across all silos

{
    "TestGrains.TestGrain.ExampleMethod2": {
    "2017-07-05T12:23:31": {
    "period": "2017-07-05T12:23:31.2230715Z",
    "siloAddress": null,
    "grain": "TestGrains.TestGrain",
    "method": "ExampleMethod2",
    "count": 2,
    "exceptionCount": 2,
    "elapsedTime": 52.1346,
    "grainAndMethod": "TestGrains.TestGrain.ExampleMethod2"
  },
  "2017-07-05T12:23:32": {
    "period": "2017-07-05T12:23:32.0823568Z",
    "siloAddress": null,
    "grain": "TestGrains.TestGrain",
    "method": "ExampleMethod2",
    "count": 5,
    "exceptionCount": 4,
    "elapsedTime": 127.04310000000001,
    "grainAndMethod": "TestGrains.TestGrain.ExampleMethod2"
  },
  ...
}

Cluster Stats

GET /ClusterStats

Returns the aggregated grain method profiling counters collected over the last 100 seconds for whole cluster.

You should only look at the values for period, count, exceptionCount and elapsedTime. The other fields are not used in this response.

{
  "2017-07-05T12:11:32": {
    "period": "2017-07-05T12:11:32.6507369Z",
    "siloAddress": null,
    "grain": null,
    "method": null,
    "count": 32,
    "exceptionCount": 4,
    "elapsedTime": 153.57039999999998,
    "grainAndMethod": "."
  },
  "2017-07-05T12:11:33": {
    "period": "2017-07-05T12:11:33.7203266Z",
    "siloAddress": null,
    "grain": null,
    "method": null,
    "count": 10,
    "exceptionCount": 2,
    "elapsedTime": 65.87930000000001,
    "grainAndMethod": "."
  },
  ...
}

Silo Stats

GET /SiloStats/{siloAddress}

Returns the aggregated grain method profiling counters collected over the last 100 seconds for that silo.

You should only look at the values for period, count, exceptionCount and elapsedTime. The other fields are not used in this response.

{
  "2017-07-05T12:11:32": {
    "period": "2017-07-05T12:11:32.6507369Z",
    "siloAddress": null,
    "grain": null,
    "method": null,
    "count": 32,
    "exceptionCount": 4,
    "elapsedTime": 153.57039999999998,
    "grainAndMethod": "."
  },
  "2017-07-05T12:11:33": {
    "period": "2017-07-05T12:11:33.7203266Z",
    "siloAddress": null,
    "grain": null,
    "method": null,
    "count": 10,
    "exceptionCount": 2,
    "elapsedTime": 65.87930000000001,
    "grainAndMethod": "."
  },
  ...
}

Silo Stats

GET /SiloCounters/{siloAddress}

Returns the current values for the Silo's counters.

[
  {
    "name": "App.Requests.Latency.Average.Millis",
    "value": "153.000",
    "delta": null
  },
  {
    "name": "App.Requests.TimedOut",
    "value": "0",
    "delta": "0"
  },
  ...
]

Top Grain Methods

GET /TopGrainMethods

Returns the top 5 grain methods in terms of requests/sec, error rate and latency

{
  "calls": [
    {
      "grain": "TestGrains.TestGrain",
      "method": "ExampleMethod2",
      "count": 1621,
      "exceptionCount": 783,
      "elapsedTime": 343.75,
      "numberOfSamples": 100
    },
    {
      "grain": "TestGrains.TestGrain",
      "method": "ExampleMethod1",
      "count": 1621,
      "exceptionCount": 0,
      "elapsedTime": 91026.73,
      "numberOfSamples": 100
    }
    ...
  ],
  "latency": [ ... ],
  "errors": [ ... ],
}

Reminders

GET /Reminders/{page}

Returns the total number of reminders, and a page of 25 reminders. If the page number is not supplied, it defaults to page 1.

{
  "count": 1500,
  "reminders": [
    {
      "grainReference": "GrainReference:*grn/D32F2751/0000007b",
      "name": "Frequent",
      "startAt": "2017-07-05T11:53:51.8648668Z",
      "period": "00:01:00",
      "primaryKey": "123"
    },
    ...
  ]
}

Trace

GET /Trace

Streams the trace log as plain text in a long running HTTP request.

More Repositories

1

Orleankka

Functional API for Microsoft Orleans http://orleanscontrib.github.io/Orleankka
C#
495
star
2

SignalR.Orleans

SignalR backend based on Orleans.
C#
291
star
3

DesignPatterns

πŸ“ Design patterns for Project Orleans
250
star
4

Orleans.Clustering.Kubernetes

Orleans Membership provider for Kubernetes
C#
186
star
5

Orleans.Sagas

A distributed saga implementation for Orleans
C#
155
star
6

Awesome-Orleans

😎 Awesome Microsoft Orleans Projects
136
star
7

Orleans.Http

An HTTP API for Microsoft Orleans
C#
107
star
8

Orleans.Providers.MongoDB

A MongoDb implementation of the Orleans Providers: Membership, Storage and Reminders.
C#
105
star
9

Orleans.Activities

Workflow Foundation (.Net 4.x System.Activities workflows) over Microsoft Orleans framework, providing stable, long-running, extremely scalable processes with XAML designer support.
C#
81
star
10

meetups

πŸ“† A repository to organise virtual meetups to discuss Orleans and other distributed systems programming on .NET
80
star
11

OrleansTestKit

Unit Test Toolkit for Microsoft Orleans
C#
79
star
12

Orleans.Redis

Redis support packages for Orleans
C#
69
star
13

OrleansFabricSilo

Orleans running on Service Fabric
C#
59
star
14

Orleans.SyncWork

This package's intention is to expose an abstract base class to allow https://github.com/dotnet/orleans/ to work with long running CPU bound synchronous work, without becoming overloaded.
C#
58
star
15

Orleans.Providers.EntityFramework

An Entity Framework Core implementation of Orleans Grain Storage. More providers to come later.
C#
50
star
16

Orleans.HttpGateway.AspNetCore

C#
50
star
17

Orleans.Indexing

C#
48
star
18

Orleans.StorageProvider.Redis

A Redis implementation of the Orleans Storage Provider model. Uses the Azure Redis Cache to persist grain states.
C#
42
star
19

Orleans.Consensus

Raft implemented on Orleans
C#
41
star
20

Orleans.CosmosDB

Orleans providers for Azure Cosmos DB
C#
40
star
21

OrleansTemplates

C#
37
star
22

Announcements

πŸ“’ Orleans related public announcements - watch this repo to stay up-to-date
37
star
23

Orleans.Providers.RabbitMQ

Orleans providers for RabbitMQ.
C#
32
star
24

Orleans.EventSourcing.Snapshot

Snapshot storage provider for orleans event sourcing
C#
30
star
25

Orleans.MultiClient

A library to simplify access to multiple Orleans Clusters from a single point.
C#
30
star
26

OrleansMonitor

Use this library to monitor the Silos in your Orleans Deployment
C#
29
star
27

Orleans.Indexing-1.5

C#
27
star
28

Orleans.Containers

Distributed storage and processing of objects in Orleans
C#
26
star
29

orleans.eventsourcing

Event Sourcing support for Microsoft Orleans
C#
20
star
30

OrleansBlobStorageProvider

DEPRECATED - now part of the orleans codebase :shipit:
C#
13
star
31

Orleans.StorageProviders.SimpleSQLServerStorage

Ultra low friction Orleans Storage Provider using SQLServer
C#
13
star
32

orleans-samples

Sample projects
C#
12
star
33

OrleansShardedStorage

A library and test application to shard Orleans grains across multiple Azure Storage Accounts
C#
12
star
34

Orleans.Extensibility.IdentityServer

Makes Orleans the backend storage for IdentityServer4
C#
11
star
35

orleans.storageprovider.ravendb

Orleans StorageProvider for RavenDB
C#
11
star
36

Orleans.TelemetryConsumers.ElasticSearch

Telemetry Consumers posting to ElasticSearch
C#
10
star
37

OrleansCassandraUtils

MSR Orleans integration with Cassandra with grain persistence, clustering and reminder table support
C#
9
star
38

Orleans.Streams.Kafka

C#
9
star
39

Orleans.Dashboard

A Microsoft Orleans Dashboard application based on Blazor
CSS
8
star
40

node-orleans

A node.js client for codename orleans
JavaScript
7
star
41

Orleans.Telemetry.SerilogConsumer

Serilog ITelemetryConsumer and ILogConsumer implementations for Orleans.
C#
7
star
42

Orleans.IdentityStore

Use Orleans as an identity store for ASP Core
C#
7
star
43

OrleansCouchbaseProvider

C#
6
star
44

Orleans.TelemetryConsumers.MetricsTracker

The purpose of MetricsTracker isn't to visualize data directly, but to provide a simple, stable, performant, and effective streaming data source to feed a growing collection of useful Orleans monitoring, diagnostics & visualization tools.
JavaScript
6
star
45

Orleans.Persistence.Minio

Minio implementation of Orleans Grain Storage Provider
C#
5
star
46

Orleans.StorageProvider.Arango

πŸ₯‘ ArangoDB Storage Provider for Microsoft Orleans
C#
4
star
47

orleans.storageprovider.documentdb

DocumentDB storage provider for Orleans
C#
4
star
48

Orleans.Clustering.Cassandra

A Cassandra implementation of the Orleans Membership Provider
C#
4
star
49

Orleans.TelemetryConsumers.Datadog

Orleans integration package for Datadog.
C#
3
star
50

orleans.serialization.json

Json serialization related libraries for Orleans.
C#
3
star
51

Orleans.Persistence.Cassandra

A Cassandra implementation of the Orleans Storage Provider
C#
3
star
52

presentations

πŸ“ƒ A repository of presentations and other marketing material for Microsoft Orleans
3
star
53

WebHostCompatibilityLayer

C#
2
star
54

Orleans.Providers.Firebase

Orleans providers for Firebase realtime database.
C#
2
star
55

Orleans.AspNetCore.SignalR

SignalR backplane based on Microsoft Orleans for ASP.NET Core
2
star
56

OrleansStatsDUtils

Orleans statistics provider for StatsD
C#
2
star
57

orleans.storageprovider.cloudservicewrapper

Azure Cloud Service Wrapper class for Orleans Storage Providers to enable configuration of settings using the Azure service configuration file
C#
1
star