示例#1
0
 /// <summary>
 /// Add custom ELK Health Checker
 /// </summary>
 /// <param name="builder">IHealthChecksBuilder</param>
 /// <param name="configuration">Current configuration root</param>
 /// <returns>IHealthChecksBuilder instance</returns>
 public static IHealthChecksBuilder AddElkHealthChecks(
     this IHealthChecksBuilder builder,
     IConfiguration configuration)
 {
     return(builder
            .AddElasticsearch(
                configuration.GetConnectionString("ELK"),
                "elasticsearch",
                HealthStatus.Degraded,
                new[] { "ready", "logs" }));
 }
 public static IHealthChecksBuilder AddElasticHealthCheck(this IHealthChecksBuilder builder,
                                                          IConfiguration configuration)
 => builder.AddElasticsearch(configuration.GetElasticsearchOptions()?.Url);