Skip to content

Commit

Permalink
FO 3.1.6, CO 2.1.5
Browse files Browse the repository at this point in the history
FO 3.1.6, CO 2.1.5
  • Loading branch information
GitTorre authored Mar 10, 2021
2 parents 9144df8 + c071a81 commit a132571
Show file tree
Hide file tree
Showing 43 changed files with 936 additions and 798 deletions.
8 changes: 4 additions & 4 deletions Build-COSFPkgs.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.ClusterObserver.Linux.SelfContained.2.1.4" "$scriptPath\bin\release\ClusterObserver\linux-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Linux.FrameworkDependent.2.1.4" "$scriptPath\bin\release\ClusterObserver\linux-x64\framework-dependent\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Linux.SelfContained.2.1.5" "$scriptPath\bin\release\ClusterObserver\linux-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Linux.FrameworkDependent.2.1.5" "$scriptPath\bin\release\ClusterObserver\linux-x64\framework-dependent\ClusterObserverType"

Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.SelfContained.2.1.4" "$scriptPath\bin\release\ClusterObserver\win-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.FrameworkDependent.2.1.4" "$scriptPath\bin\release\ClusterObserver\win-x64\framework-dependent\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.SelfContained.2.1.5" "$scriptPath\bin\release\ClusterObserver\win-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.FrameworkDependent.2.1.5" "$scriptPath\bin\release\ClusterObserver\win-x64\framework-dependent\ClusterObserverType"
}
finally {
Pop-Location
Expand Down
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.5" "$scriptPath\bin\release\FabricObserver\linux-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.FrameworkDependent.3.1.5" "$scriptPath\bin\release\FabricObserver\linux-x64\framework-dependent\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.SelfContained.3.1.6" "$scriptPath\bin\release\FabricObserver\linux-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.FrameworkDependent.3.1.6" "$scriptPath\bin\release\FabricObserver\linux-x64\framework-dependent\FabricObserverType"

Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.1.5" "$scriptPath\bin\release\FabricObserver\win-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.FrameworkDependent.3.1.5" "$scriptPath\bin\release\FabricObserver\win-x64\framework-dependent\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.1.6" "$scriptPath\bin\release\FabricObserver\win-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.FrameworkDependent.3.1.6" "$scriptPath\bin\release\FabricObserver\win-x64\framework-dependent\FabricObserverType"
}
finally {
Pop-Location
Expand Down
4 changes: 2 additions & 2 deletions ClusterObserver.nuspec.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3.0">
<id>%PACKAGE_ID%</id>
<version>2.1.4</version>
<releaseNotes>FO 3.1.5 support. Bug fixes. Significant refactoring.</releaseNotes>
<version>2.1.5</version>
<releaseNotes>FO 3.1.6 support.</releaseNotes>
<authors>Microsoft</authors>
<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
20 changes: 10 additions & 10 deletions ClusterObserver/ClusterObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private async Task ReportClusterHealthAsync(CancellationToken token)
var telemetry = new TelemetryData(FabricClientInstance, token)
{
HealthState = "Ok",
HealthEventDescription = "Cluster has recovered from previous Error/Warning state.",
Description = "Cluster has recovered from previous Error/Warning state.",
Metric = "AggregatedClusterHealth",
Source = ObserverName,
};
Expand Down Expand Up @@ -335,7 +335,7 @@ e is TimeoutException ||
var telemetryData = new TelemetryData(FabricClientInstance, token)
{
HealthState = "Warning",
HealthEventDescription = msg,
Description = msg,
};

await ObserverTelemetryClient.ReportHealthAsync(telemetryData, token);
Expand Down Expand Up @@ -435,7 +435,7 @@ private async Task ProcessApplicationHealthAsync(IList<ApplicationHealthState> a
{
ApplicationName = appName.OriginalString,
HealthState = Enum.GetName(typeof(HealthState), appHealth.AggregatedHealthState),
HealthEventDescription = telemetryDescription,
Description = telemetryDescription,
Source = ObserverName,
};

Expand Down Expand Up @@ -486,7 +486,7 @@ private async Task ProcessApplicationHealthAsync(IList<ApplicationHealthState> a
{
foTelemetryData.ApplicationName,
foTelemetryData.HealthState,
foTelemetryData.HealthEventDescription,
foTelemetryData.Description,
foTelemetryData.Metric,
foTelemetryData.ObserverName,
foTelemetryData.NodeName,
Expand Down Expand Up @@ -519,7 +519,7 @@ private async Task ProcessApplicationHealthAsync(IList<ApplicationHealthState> a
{
ApplicationName = appName.OriginalString,
HealthState = Enum.GetName(typeof(HealthState), appHealth.AggregatedHealthState),
HealthEventDescription = telemetryDescription,
Description = telemetryDescription,
Source = ObserverName,
};

Expand Down Expand Up @@ -596,7 +596,7 @@ private async Task ProcessNodeHealthAsync(IList<NodeHealthState> nodeHealthState
// From FO?
if (foStats != null)
{
telemetryDescription += foStats.HealthEventDescription;
telemetryDescription += foStats.Description;
sourceObserver = foStats.ObserverName;
metric = foStats.Metric;
}
Expand Down Expand Up @@ -626,7 +626,7 @@ await FabricClientInstance.QueryManager.GetNodeListAsync(
{
NodeName = node.NodeName,
HealthState = Enum.GetName(typeof(HealthState), node.AggregatedHealthState),
HealthEventDescription = $"{telemetryDescription}{Environment.NewLine}Node Status: {(targetNode != null ? Enum.GetName(typeof(NodeStatus), targetNode.NodeStatus) : string.Empty)}",
Description = $"{telemetryDescription}{Environment.NewLine}Node Status: {(targetNode != null ? Enum.GetName(typeof(NodeStatus), targetNode.NodeStatus) : string.Empty)}",
Metric = metric ?? "AggregatedClusterHealth",
ObserverName = sourceObserver ?? string.Empty,
Source = ObserverName,
Expand Down Expand Up @@ -675,7 +675,7 @@ private async Task ProcessGenericEntityHealthAsync(HealthEvaluation evaluation,

var telemetryData = new TelemetryData(FabricClientInstance, token)
{
HealthEventDescription = telemetryDescription,
Description = telemetryDescription,
HealthState = healthState,
Source = ObserverName,
};
Expand Down Expand Up @@ -728,7 +728,7 @@ await FabricClientInstance.QueryManager.GetNodeListAsync(
var telemetry = new TelemetryData(FabricClientInstance, token)
{
HealthState = "Ok",
HealthEventDescription = $"{nodeDictItem.Key} is now Up.",
Description = $"{nodeDictItem.Key} is now Up.",
Metric = "NodeStatus",
NodeName = nodeDictItem.Key,
Value = "Up",
Expand Down Expand Up @@ -807,7 +807,7 @@ await FabricClientInstance.QueryManager.GetNodeListAsync(
var telemetry = new TelemetryData(FabricClientInstance, token)
{
HealthState = "Warning",
HealthEventDescription = message,
Description = message,
Metric = "NodeStatus",
NodeName = kvp.Key,
Value = $"{kvp.Value.NodeStatus}",
Expand Down
6 changes: 3 additions & 3 deletions ClusterObserver/PackageRoot/ServiceManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="ClusterObserverPkg"
Version="2.1.4"
Version="2.1.5"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Expand All @@ -11,7 +11,7 @@
</ServiceTypes>

<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="2.1.4">
<CodePackage Name="Code" Version="2.1.5">
<EntryPoint>
<ExeHost>
<Program>ClusterObserver</Program>
Expand All @@ -21,7 +21,7 @@

<!-- Config package is the contents of the Config directory under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="2.1.4" />
<ConfigPackage Name="Config" Version="2.1.5" />

<Resources>
<Endpoints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public Task ReportHealthAsync(
{ "Application", telemetryData.ApplicationName ?? string.Empty },
{ "ClusterId", telemetryData.ClusterId ?? string.Empty },
{ "ErrorCode", telemetryData.Code ?? string.Empty },
{ "HealthEventDescription", telemetryData.HealthEventDescription ?? string.Empty },
{ "Description", telemetryData.Description ?? string.Empty },
{ "HealthState", telemetryData.HealthState ?? string.Empty },
{ "Metric", telemetryData.Metric ?? string.Empty },
{ "NodeName", telemetryData.NodeName ?? string.Empty },
Expand Down
2 changes: 1 addition & 1 deletion ClusterObserver/Utilities/Telemetry/TelemetryData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public string ContainerId
get; set;
}

public string HealthEventDescription
public string Description
{
get; set;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ClusterObserverType" ApplicationTypeVersion="2.1.4" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ClusterObserverType" ApplicationTypeVersion="2.1.5" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<!-- ClusterObserver settings. -->
<Parameter Name="ClusterObserver_InstanceCount" DefaultValue="1" />
Expand All @@ -14,7 +14,7 @@
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="ClusterObserverPkg" ServiceManifestVersion="2.1.4" />
<ServiceManifestRef ServiceManifestName="ClusterObserverPkg" ServiceManifestVersion="2.1.5" />
<ConfigOverrides>
<ConfigOverride Name="Config">
<Settings>
Expand Down
92 changes: 91 additions & 1 deletion Documentation/Using.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Example Output in SFX:
![alt text](/Documentation/Images/DiskWarnDescriptionNode.jpg "Logo Title Text 1")


**Memory Usage**
**Memory Usage - Private Working Set as Percentage of Total Physical Memory**

***Problem:*** I want to know how much memory some or all of my services are using and warn when they hit some meaningful percent-used thresold.

Expand All @@ -137,6 +137,32 @@ The third one scopes to all services _but_ 3 and asks AppObserver to warn when a
}
```

**Memory Usage - Private Working Set - MB in Use**

***Problem:*** I want to know how much memory some or all of my services are using and warn when they hit some meaningful Megabytes in use thresold.

***Solution:*** AppObserver is your friend.

The first two JSON objects below tell AppObserver to warn when any of the services under MyApp app reach 30% memory use (as a percentage of total memory).

The third one scopes to all services _but_ 3 and asks AppObserver to warn when any of them hit 40% memory use on the machine (virtual or not).

```JSON
{
"targetApp": "fabric:/MyApp",
"memoryWarningLimitMb": 300
},
{
"targetApp": "fabric:/AnotherApp",
"memoryWarningLimitMb": 500
},
{
"targetApp": "fabric:/SomeOtherApp",
"serviceExcludeList": "WhoNeedsMemoryService, NoMemoryNoProblemService, Service42",
"memoryWarningLimitMb": 600
}
```


**Different thresholds for different services belonging to the same app**

Expand Down Expand Up @@ -187,6 +213,70 @@ The following configuration tells AppObserver to monitor and report Warnings for
}
```

**All App Monitoring**

***Problem:*** I don't care what the app is, I just want to monitor all app services deployed to any node.

***Solution:*** AppObserver is your friend. Note, you can specify all app targets using either "*" or "All" (case doesn't matter).
The configuration below specifies that AppObserver is to monitor and report thresholds breaches for a collection of metrics on all services belong to any app that is deployed to the node.
Note that AppObserver does not (and will not) monitor fabric:/System app services. Also, individual targetApp configuration items will override the global configuration when there the same metrics are supplied.
So, in the example below, the setting for cpuWarningLimitPercent for fabric:/MyApp will override the same setting specified in the all inclusive config item. fabric:/MyApp will still be monitored for the other global metrics.

```JSON
[
{
"targetApp": "*",
"cpuWarningLimitPercent": 75,
"memoryWarningLimitMb" : 500,
"networkWarningActivePorts": 2000,
"networkWarningEphemeralPorts": 1500
},
{
"targetApp": "fabric:/MyApp",
"cpuWarningLimitPercent": 50
}
]
```
***Problem:*** I don't care what the app is, I just want to monitor all app services deployed to any node, except for fabric:/MyApp, where I only care about raw memory use (MB) by any of its services.

***Solution:*** AppObserver is your friend. Note, you can specify all app targets using either "*", "All", or "Any" (case doesn't matter).
The configuration below specifies that AppObserver is to monitor and report thresholds breaches for a collection of metrics on all services belong to any app that is deployed to the node, except for fabric:/MyApp.

```JSON
[
{
"targetApp": "*",
"appExcludeList": "fabric:/MyApp",
"cpuWarningLimitPercent": 75,
"memoryWarningLimitPerceent" : 40,
"networkWarningActivePorts": 2000,
"networkWarningEphemeralPorts": 1500
},
{
"targetApp": "fabric:/MyApp",
"memoryWarningLimitMb": 600
}
]
```
***Problem:*** I want to monitor the same resource metrics used by 3 apps and I don't like writing JSON.

***Solution:*** AppObserver is your friend. Note, you can specify all app targets using either "*", "All", or "Any" (case doesn't matter).
The configuration below specifies that AppObserver is to monitor and report thresholds breaches for a collection of metrics on all services that belong to the apps supplied in appIncludeList.

```JSON
[
{
"targetApp": "*",
"appIncludeList": "fabric:/MyApp, fabric:/MyApp2, fabric:/MyApp3",
"cpuWarningLimitPercent": 75,
"memoryWarningLimitPerceent" : 40,
"networkWarningActivePorts": 2000,
"networkWarningEphemeralPorts": 1500
}
]

```

> You can learn all about the currently implemeted Observers and their supported resource properties [***here***](/Documentation/Observers.md).

Expand Down
19 changes: 12 additions & 7 deletions FabricObserver.Extensibility/MachineInfoModel/ApplicationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ public string TargetAppType
get; set;
}

public string AppExcludeList
{
get; set;
}

public string AppIncludeList
{
get; set;
}

public string ServiceExcludeList
{
get; set;
Expand Down Expand Up @@ -84,11 +94,6 @@ public int NetworkErrorFirewallRules
get; set;
}

public int NetworkWarningFirewallRules
{
get; set;
}

public bool DumpProcessOnError
{
get; set;
Expand All @@ -106,6 +111,8 @@ public int WarningOpenFileHandles

public override string ToString() => $"ApplicationName: {TargetApp ?? string.Empty}{Environment.NewLine}" +
$"ApplicationTypeName: {TargetAppType ?? string.Empty}{Environment.NewLine}" +
$"AppExcludeList: {AppExcludeList ?? string.Empty}{Environment.NewLine}" +
$"AppIncludeList: {AppIncludeList ?? string.Empty}{Environment.NewLine}" +
$"ServiceExcludeList: {ServiceExcludeList ?? string.Empty}{Environment.NewLine}" +
$"ServiceIncludeList: {ServiceIncludeList ?? string.Empty}{Environment.NewLine}" +
$"MemoryWarningLimitMB: {MemoryWarningLimitMb}{Environment.NewLine}" +
Expand All @@ -118,8 +125,6 @@ public override string ToString() => $"ApplicationName: {TargetApp ?? string.Emp
$"NetworkWarningActivePorts: {NetworkWarningActivePorts}{Environment.NewLine}" +
$"NetworkErrorEphemeralPorts: {NetworkErrorEphemeralPorts}{Environment.NewLine}" +
$"NetworkWarningEphemeralPorts: {NetworkWarningEphemeralPorts}{Environment.NewLine}" +
$"NetworkErrorFirewallRules: {NetworkErrorFirewallRules}{Environment.NewLine}" +
$"NetworkWarningFirewallRules: {NetworkWarningFirewallRules}{Environment.NewLine}" +
$"DumpProcessOnError: {DumpProcessOnError}{Environment.NewLine}" +
$"ErrorOpenFileHandles: {ErrorOpenFileHandles}{Environment.NewLine}" +
$"WarningOpenFileHandles: {WarningOpenFileHandles}{Environment.NewLine}";
Expand Down
Loading

0 comments on commit a132571

Please sign in to comment.