Skip to content

Commit

Permalink
FO 3.1.16
Browse files Browse the repository at this point in the history
FO 3.1.16
  • Loading branch information
GitTorre authored Jul 29, 2021
2 parents 69bb503 + b87cd7c commit aa0872e
Show file tree
Hide file tree
Showing 41 changed files with 1,763 additions and 650 deletions.
8 changes: 4 additions & 4 deletions Build-SFPkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ function Build-SFPkg {
try {
Push-Location $scriptPath

Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.SelfContained.3.1.15" "$scriptPath\bin\release\FabricObserver\linux-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.FrameworkDependent.3.1.15" "$scriptPath\bin\release\FabricObserver\linux-x64\framework-dependent\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.SelfContained.3.1.16" "$scriptPath\bin\release\FabricObserver\linux-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.FrameworkDependent.3.1.16" "$scriptPath\bin\release\FabricObserver\linux-x64\framework-dependent\FabricObserverType"

Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.1.15" "$scriptPath\bin\release\FabricObserver\win-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.FrameworkDependent.3.1.15" "$scriptPath\bin\release\FabricObserver\win-x64\framework-dependent\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.1.16" "$scriptPath\bin\release\FabricObserver\win-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.FrameworkDependent.3.1.16" "$scriptPath\bin\release\FabricObserver\win-x64\framework-dependent\FabricObserverType"
}
finally {
Pop-Location
Expand Down
27 changes: 14 additions & 13 deletions ClusterObserver/ClusterObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,12 @@ private async Task ReportClusterHealthAsync(CancellationToken token)
{

}

break;

case HealthEvaluationKind.Application:
case HealthEvaluationKind.Applications:
case HealthEvaluationKind.SystemApplication:

try
{
await ProcessApplicationHealthAsync(clusterHealth.ApplicationHealthStates, token).ConfigureAwait(true);
Expand All @@ -264,9 +265,10 @@ private async Task ReportClusterHealthAsync(CancellationToken token)
{

}

break;

default:

try
{
await ProcessGenericEntityHealthAsync(evaluation, token).ConfigureAwait(true);
Expand All @@ -275,7 +277,6 @@ private async Task ReportClusterHealthAsync(CancellationToken token)
{

}

break;
}
}
Expand Down Expand Up @@ -633,7 +634,8 @@ private async Task MonitorNodeStatusAsync(CancellationToken token)
Description = $"{nodeDictItem.Key} is now Up.",
Metric = "NodeStatus",
NodeName = nodeDictItem.Key,
Source = ObserverName
Source = ObserverName,
Value = 0
};

await ObserverTelemetryClient.ReportHealthAsync(telemetry, token);
Expand All @@ -646,13 +648,12 @@ private async Task MonitorNodeStatusAsync(CancellationToken token)
ObserverConstants.ClusterObserverETWEventName,
new
{
HealthScope = "Node",
HealthState = "Ok",
HealthEventDescription = $"{nodeDictItem.Key} is now Up.",
Description = $"{nodeDictItem.Key} is now Up.",
Metric = "NodeStatus",
NodeName = nodeDictItem.Key,
NodeStatus = "Up",
Source = ObserverName
Source = ObserverName,
Value = 0
});
}

Expand Down Expand Up @@ -706,7 +707,8 @@ private async Task MonitorNodeStatusAsync(CancellationToken token)
Description = message,
Metric = "NodeStatus",
NodeName = kvp.Key,
Source = ObserverName
Source = ObserverName,
Value = 1,
};

await ObserverTelemetryClient.ReportHealthAsync(telemetry, token);
Expand All @@ -719,13 +721,12 @@ private async Task MonitorNodeStatusAsync(CancellationToken token)
ObserverConstants.ClusterObserverETWEventName,
new
{
HealthScope = "Node",
HealthState = "Warning",
HealthEventDescription = message,
Description = message,
Metric = "NodeStatus",
NodeName = kvp.Key,
NodeStatus = $"{kvp.Value.NodeStatus}",
Source = ObserverName
Source = ObserverName,
Value = 1,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion ClusterObserver/ClusterObserver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
<PackageReference Include="Microsoft.ServiceFabric.Diagnostics.Internal" Version="4.2.452" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="4.2.452" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.9" />
<PackageReference Include="NLog" Version="4.7.10" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public Task ReportHealthAsync(TelemetryData telemetryData, CancellationToken can
{ "ErrorCode", telemetryData.Code ?? string.Empty },
{ "Description", telemetryData.Description ?? string.Empty },
{ "Metric", telemetryData.Metric ?? string.Empty },
{ "Value", telemetryData.Value.ToString() },
{ "Value", telemetryData.Value == 0 ? "Up" : "Down" },
{ "Partition", telemetryData.PartitionId },
{ "Replica", telemetryData.ReplicaId.ToString() },
{ "Source", telemetryData.ObserverName },
Expand Down
6 changes: 2 additions & 4 deletions ClusterObserver/Utilities/Telemetry/LogAnalyticsTelemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,8 @@ private string GetSignature(
string message = $"{method}\n{contentLength}\n{contentType}\nx-ms-date:{date}\n{resource}";
byte[] bytes = Encoding.UTF8.GetBytes(message);

using (var encryptor = new HMACSHA256(Convert.FromBase64String(Key)))
{
return $"SharedKey {WorkspaceId}:{Convert.ToBase64String(encryptor.ComputeHash(bytes))}";
}
using var encryptor = new HMACSHA256(Convert.FromBase64String(Key));
return $"SharedKey {WorkspaceId}:{Convert.ToBase64String(encryptor.ComputeHash(bytes))}";
}

// These two overloads of ReportHealthAsync are the only function impls that really makes sense for ClusterObserver
Expand Down
Loading

0 comments on commit aa0872e

Please sign in to comment.