public void ReportHealth(HealthReport healthReport, HealthReportSendOptions sendOptions)
        {
            Uri serviceName = null;

            if (healthReport is ServiceHealthReport service)
            {
                serviceName = service.ServiceName;
            }
            _logger.LogDebug($"Reporting health, kind={healthReport.Kind}, healthState={healthReport.HealthInformation.HealthState}, type={healthReport.GetType().FullName}, serviceName={serviceName}");

            _healthClientWrapper.ReportHealth(healthReport, sendOptions);
        }
Пример #2
0
        public void ReportHealth(HealthReport healthReport, HealthReportSendOptions sendOptions)
        {
            Uri serviceName = null;

            if (healthReport is ServiceHealthReport service)
            {
                serviceName = service.ServiceName;
            }
            Log.ReportHealth(_logger, healthReport.Kind, healthReport.HealthInformation.HealthState, healthReport.GetType().FullName, serviceName);

            _healthClientWrapper.ReportHealth(healthReport, sendOptions);
        }
Пример #3
0
        public void ReportHealth(HealthReport healthReport, HealthReportSendOptions sendOptions)
        {
            //_operationLogger.Execute(
            //    $"{ConfigurationValues.ExtensionName}.ServiceFabric.ReportHealth",
            //    () =>
            //    {
            //        var operationContext = _operationLogger.Context;
            //        operationContext?.SetProperty("kind", healthReport.Kind.ToString());
            //        operationContext?.SetProperty("healthState", healthReport.HealthInformation.HealthState.ToString());
            //        switch (healthReport)
            //        {
            //            case ServiceHealthReport service:
            //                operationContext?.SetProperty("serviceName", service.ServiceName.ToString());
            //                break;
            //            default:
            //                operationContext?.SetProperty("type", healthReport.GetType().FullName);
            //                break;
            //        }

            //        _healthClientWrapper.ReportHealth(healthReport, sendOptions);
            //    });
            Uri serviceName = null;

            if (healthReport is ServiceHealthReport service)
            {
                serviceName = service.ServiceName;
            }
            _logger.LogDebug($"Reporting health, kind='{healthReport.Kind}', healthState='{healthReport.HealthInformation.HealthState}', type='{healthReport.GetType().FullName}', serviceName='{serviceName}'");

            _healthClientWrapper.ReportHealth(healthReport, sendOptions);
        }