Skip to content

1.0.0-Beta2

Pre-release
Pre-release

Choose a tag to compare

@andreasohlund andreasohlund released this 21 Nov 13:49

Introduction

Particular Software ServicePulse is the new operational monitoring tool for distributed applications developed using NServiceBus.

An Introduction to ServicePulse for NServiceBus provides a short ~7 minute introductory video and demo of ServicePulse capabilities and main features for this Beta release.

Prerequisites

  • .NET Framework 4.0 or later
  • Particular Software ServiceControl Beta 4
  • Monitored NServiceBus endpoints must use NServiceBus 4.0.0 or higher
    • (support for earlier releases will be added in a future release)

Downloads

Installation

  1. Download and install ServiceControl 1.0.0 Beta 4 (see release notes)
  2. Download and install ServicePulse 1.0.0 Beta 2
  3. The following installation parameters are used by the ServicePulse installer:
    • ServicePulse Instance URI:
      • Default is http://localhost:8082
      • This is the localhost address and port that will be used for accessing the ServicePulse web application
    • ServiceControl instance URI:
  4. After accepting the license terms and conditions, click "Install" (installer will require elevated privileges)
  5. The installation process performs the following actions:
    • Installs the Windows Service "Particular ServicePulse" which hosts the web application
    • Open the ServicePulse web application using the default browser
  6. After installing ServicePulse, you will need to:
    1. Configure your NServiceBus applications endpoints
    2. Author and deploy Custom Checks that will be monitored by ServicePulse.
  7. See the following sections for detailed guidance on performing these actions

HOWTO: Configure endpoints for monitoring by ServicePulse

ServicePulse monitors NServiceBus endpoints for:

  1. Endpoint availability (using heartbeat signals sent from the endpoint)
  2. Failed Messages (by monitoring the error queue defined for the endpoints)
  3. Custom Checks (defined and developed per application needs)
  4. And more (see An Introduction to ServicePulse for NServiceBus for additional upcoming monitoring features

image

Prerequisites for ServicePulse monitoring of endpoints:

  1. An Endpoint Plugin dll must be deployed in the binaries directory of each NServiceBus endpoint (required for endpoint availability and Custom Checks monitoring)
  2. Endpoints must use NServiceBus version 4.0.0 or higher (support for earlier releases will be added in a future release)
  3. Auditing must be enabled for all monitored endpoints (see Auditing With NServiceBus)
  4. All endpoints must forward audited data to a single audit and error queue, that is monitored by a ServiceControl instance

Deploying Endpoint Plugin in each Endpoint

  1. The Endpoint Plugin consists of two DLL files:
    • ServiceControl.EndpointPlugin.dll
    • ServiceControl.EndpointPlugin.Messages.dll
  2. Get the Endpoint Plugin:
  3. Copy the Endpoint Plugin files to each endpoint bin directory (and restart the endpoint to load the plugin)
  4. By default, the Endpoint Plugin sends a heartbeat indication to ServiceControl every 30 seconds.
    • If a heartbeat indication is not recevied within 30 seconds, ServicePulse raises an event indicates the issue

HOWTO: Develop Custom Checks for ServicePulse

  1. In Visual Studio, create a new Class Library project
  2. Add the Endpoint Plugin to the project
    • Download a zip file containing the Endpoint Plugin DLL's and place them in the endpoint's Bin directory
    • using NuGet: install-package ServiceControl.EndpointPlugin -pre
    • Or by copying the Endpoint Plugin DLL's to the endpoint's bin directory
  3. Add a reference to the Endpoint Plugin DLL's
  4. To create a custom check that executes once, on endpoint startup, create a class that inherits from CustomCheck class (see sample code below)
  5. To create a custom check that executes repeatedly, in defined time intervals, create a class that inherits from PeriodicCheck class (see sample code below)
  6. Build and deploy the class library DLL in the Bin directory of the endpoint you wish to execute these custom checks
    • You can deploy many custom checks per endpoint, and deploy the same custom checks in as many endpoints as required
Sample Custom Check
using System;
using System.IO;

// reference ServiceControl.EndpointPlugin.dll
using ServiceControl.EndpointPlugin.CustomChecks;           
// reference ServiceControl.EndpointPlugin.Messages.dll
using ServiceControl.EndpointPlugin.Messages.CustomChecks;  

namespace CustomCheckSample
{
    // Run the custom check once, on endpoint startup
    class FtpAvailabilityCheck : CustomCheck
    {
        public static bool isAvailable = false;

        public FtpAvailabilityCheck()
            : base("FTP server availability check", "FTP Server") 
        {
            if (!isAvailable) 
                ReportFailed("The FTP Service is down");
        }
    }

    // Run the custom check periodically, in the defined interval timespan
    class FtpStorageDirectoryCheck : PeriodicCheck
    {
        public FtpStorageDirectoryCheck()
            : base("FTP storage directory check", "FTP Server", TimeSpan.FromSeconds(5)){}

        public override CheckResult PerformCheck()
        {
            var dir = @"C:\Client\1035";
            if (!Directory.Exists(dir))
            {
                return CheckResult.Failed(string.Format("FTP storage directory '{0}' does not exist", dir));                
            }
            return CheckResult.Pass;
        }
    }
}

Troubleshooting:

  1. ServicePulse is unable to connect to ServiceControl
    • See ServiceControl release notes Troubleshooting section for guidance on detecting ServiceControl HTTP API accessibility
    • Verify that ServicePulse is trying to access the correct ServiceControl URI (based on ServicControl instance URI defined in ServicePulse installation settings)
    • Check that ServicePulse is not blocked from accessing the ServiceControl URI by firewall settings
  2. ServicePulse reports that 0 endpoints are active, although Endpoint plugins were deployed
    • Make sure you follow the guidance in the section "Deploying Endpoint Plugin in each Endpoint" above
    • Restart the endpoint after copying the Endpoint Plugin files into the endpoint's Bin directory
    • Make sure that the endpoint references NServiceBus 4.0.0 or later
    • Make sure auditing is turned on for the endpoint, and the audited messages are forwarded to the correct audit and error queues monitored by ServiceControl

Changes in this release

This release consist of these issues that were achieved through these commits.

Features

#12 Implement Heartbeat Events viewing

Improvements

#55 Add Start Menu shortcut to launch website

Bugs

#60 When exception text is too long, UI looks a bit messy

#58 Misleading custom check failed events (appears once for all endpoints)

#49 CustomChecks from multiple endpoints count as a single check

#48 Failed Messages list requires manual refresh to display correct result

#47 Failed Message summary statistics is empty

#45 Phrasing consistency: events category in plural or singular

#42 Install-Package for EndpointPlugin causes build failure due to invalid dependency

#20 Number of endpoints zero'd on SC restart