Exemplo n.º 1
0
 /// <summary>
 ///     Add Application insights integration for results.
 /// </summary>
 /// <param name="healthChecksBuilder">aspnet auto health check builder.</param>
 /// <returns></returns>
 public static IAutoHealthCheckBuilder AddAIResultPlugin(
     this IAutoHealthCheckBuilder healthChecksBuilder)
 {
     healthChecksBuilder.AddSingleton <ApplicationInsightsResultPlugin>();
     healthChecksBuilder.AddSingleton <ITelemetryServices, TelemetryServices>();
     return(healthChecksBuilder);
 }
Exemplo n.º 2
0
 /// <summary>
 ///     With this mode the principal endpoint will be Diagnostic health check one and this will
 ///     call to auto health check endpoint within automatic IHealthCheck implementation.
 /// </summary>
 /// <param name="healthChecksBuilder"></param>
 /// <param name="path">path where diagnostic endpoint should be called.</param>
 /// <returns></returns>
 public static IAutoHealthCheckBuilder AddAspNetCoreDiagnosticHealthCheck(
     this IAutoHealthCheckBuilder healthChecksBuilder,
     string path)
 {
     // set path
     AspNetCoreDiagnosticHealthCheckProbe.Path = path;
     healthChecksBuilder.AddCustomProbe <AspNetCoreDiagnosticHealthCheckProbe>();
     return(healthChecksBuilder);
 }
Exemplo n.º 3
0
        /// <summary>
        ///     Add custom probe work.
        /// </summary>
        /// <typeparam name="TProbe">Probe type to add to the work queue.</typeparam>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static IAutoHealthCheckBuilder AddCustomProbe <TProbe>(this IAutoHealthCheckBuilder builder)
            where TProbe : class, IProbe
        {
            if (_contextAccessor == null)
            {
                throw new InvalidOperationException("Please first call AddAutoHealthCheck method.");
            }

            // register probe in the IOC engine.
            builder.AddTransient(typeof(TProbe));

            // add the probe to context
            var context = (AutoHealthCheckContext)_contextAccessor.Context;

            context.AddProbe <TProbe>();

            return(builder);
        }
Exemplo n.º 4
0
 public static IAutoHealthCheckBuilder AddAzureStorageIntegration(this IAutoHealthCheckBuilder healthChecksBuilder)
 {
     healthChecksBuilder.AddSingleton <AzureStorageResultPlugin>();
     healthChecksBuilder.AddSingleton <IStorageService, StorageService>();
     return(healthChecksBuilder);
 }
 public static IAutoHealthCheckBuilder AddRaygunIntegration(
     this IAutoHealthCheckBuilder healthChecksBuilder)
 {
     healthChecksBuilder.AddSingleton <RaygunResultPlugin>();
     return(healthChecksBuilder);
 }