Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppObserver Linux Bug #308

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.3.0" "$scriptPath\bin\release\FabricObserver\linux-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.FrameworkDependent.3.3.0" "$scriptPath\bin\release\FabricObserver\linux-x64\framework-dependent\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.SelfContained.3.3.1" "$scriptPath\bin\release\FabricObserver\linux-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Linux.FrameworkDependent.3.3.1" "$scriptPath\bin\release\FabricObserver\linux-x64\framework-dependent\FabricObserverType"

Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.3.0" "$scriptPath\bin\release\FabricObserver\win-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.FrameworkDependent.3.3.0" "$scriptPath\bin\release\FabricObserver\win-x64\framework-dependent\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.3.1" "$scriptPath\bin\release\FabricObserver\win-x64\self-contained\FabricObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricObserver.Windows.FrameworkDependent.3.3.1" "$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
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3.0">
<metadata minClientVersion="3.3.1">
<id>%PACKAGE_ID%</id>
<version>2.3.0</version>
<releaseNotes>
Expand All @@ -20,7 +20,7 @@
<dependencies>
<group targetFramework="net8.0">
<dependency id="Microsoft.ServiceFabric.Services" version="6.0.1017" />
<dependency id="Microsoft.ServiceFabricApps.FabricObserver.Extensibility" version="3.3.0" />
<dependency id="Microsoft.ServiceFabricApps.FabricObserver.Extensibility" version="3.3.1" />
</group>
</dependencies>
<projectUrl>https://aka.ms/sf/FabricObserver</projectUrl>
Expand Down
6 changes: 3 additions & 3 deletions Documentation/Deployment/service-fabric-observer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
},
"applicationTypeVersionFabricObserver": {
"type": "string",
"defaultValue": "3.3.0",
"defaultValue": "3.3.1",
"metadata": {
"description": "Provide the app version number of FabricObserver. This must be identical to the version, 3.3.0, in the referenced sfpkg specified in packageUrlFabricObserver."
"description": "Provide the app version number of FabricObserver. This must be identical to the version, 3.3.1, in the referenced sfpkg specified in packageUrlFabricObserver."
}
},
"packageUrlFabricObserver": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "This has to be a public accessible URL for the sfpkg file which contains the FabricObserver app package. Example: https://github.com/microsoft/service-fabric-observer/releases/download/[xxxxxxxx]/Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.3.0.sfpkg"
"description": "This has to be a public accessible URL for the sfpkg file which contains the FabricObserver app package. Example: https://github.com/microsoft/service-fabric-observer/releases/download/[xxxxxxxx]/Microsoft.ServiceFabricApps.FabricObserver.Windows.SelfContained.3.3.1.sfpkg"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "<YOUR-CLUSTER-RESOURCE-NAME>"
},
"applicationTypeVersionFabricObserver": {
"value": "3.3.0"
"value": "3.3.1"
},
"packageUrlFabricObserver": {
"value": "<PUBLIC-ACCESSIBLE-URL-FOR-FABRICOBSERVER-SFPKG>"
Expand Down
4 changes: 2 additions & 2 deletions Documentation/OperationalTelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ As with most of FabricObserver's application settings, you can also do this with
Connect-ServiceFabricCluster ...

$appParams = @{ "ObserverManagerEnableOperationalFOTelemetry" = "false"; }
Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/FabricObserver -ApplicationParameter $appParams -ApplicationTypeVersion 3.3.0 -UnMonitoredAuto
Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/FabricObserver -ApplicationParameter $appParams -ApplicationTypeVersion 3.3.1 -UnMonitoredAuto

```

Expand All @@ -44,7 +44,7 @@ Here is a full example of exactly what is sent in one of these telemetry events,
"ClusterId": "00000000-1111-1111-0000-00f00d000d",
"ClusterType": "SFRP",
"NodeNameHash": "3e83569d4c6aad78083cd081215dafc81e5218556b6a46cb8dd2b183ed0095ad",
"FOVersion": "3.3.0",
"FOVersion": "3.3.1",
"HasPlugins": "False",
"SFRuntimeVersion":"9.0.1028.9590"
"UpTime": "1.00:30:18.8058379",
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ cd C:\Users\me\source\repos\service-fabric-observer
./Build-FabricObserver
./Build-NugetPackages
```
The output from the above commands contains FabricObserver platform-specific nupkgs and a nupkg you have to use for plugin authoring named Microsoft.ServiceFabricApps.FabricObserver.Extensibility.3.3.0.nupkg. Nuget packages will be located in
The output from the above commands contains FabricObserver platform-specific nupkgs and a nupkg you have to use for plugin authoring named Microsoft.ServiceFabricApps.FabricObserver.Extensibility.3.3.1.nupkg. Nuget packages will be located in
C:\Users\me\source\repos\service-fabric-observer\bin\release\FabricObserver\Nugets.
4 changes: 2 additions & 2 deletions Documentation/Using.md
Original file line number Diff line number Diff line change
Expand Up @@ -708,15 +708,15 @@ $appParams = @{ "FabricSystemObserverEnabled" = "true"; "FabricSystemObserverMem
Then execute the application upgrade with

```Powershell
Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/FabricObserver -ApplicationTypeVersion 3.3.0 -ApplicationParameter $appParams -Monitored -FailureAction rollback
Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/FabricObserver -ApplicationTypeVersion 3.3.1 -ApplicationParameter $appParams -Monitored -FailureAction rollback
```

**Important**: This action will overwrite previous app paramemter changes that were made in an earlier application upgrade, for example. If you want to preserve any earlier changes, then you will need to
supply those parameter values again along with the new ones. You do this in the following, simple way:

```PowerShell
$appName = "fabric:/FabricObserver"
$appVersion = "3.3.0"
$appVersion = "3.3.1"
$application = Get-ServiceFabricApplication -ApplicationName $appName
$appParamCollection = $application.ApplicationParameters
$applicationParameterMap = @{}
Expand Down
4 changes: 2 additions & 2 deletions FabricObserver.Extensibility.nuspec.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3.0">
<metadata minClientVersion="3.3.1">
<id>%PACKAGE_ID%</id>
<version>3.3.0</version>
<version>3.3.1</version>
<releaseNotes>
This is the .NET 8 implementation of FabricObserver's Extensibility library. Use this library to build .NET 8 FabricObserver and ClusterObserver plugins.
</releaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<RootNamespace>FabricObserver</RootNamespace>
<Copyright>Copyright © 2024</Copyright>
<Product>FabricObserver</Product>
<Version>3.3.0</Version>
<FileVersion>3.3.0</FileVersion>
<Version>3.3.1</Version>
<FileVersion>3.3.1</FileVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
Expand Down
8 changes: 3 additions & 5 deletions FabricObserver.nuspec.template
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3.0">
<metadata minClientVersion="3.3.1">
<id>%PACKAGE_ID%</id>
<version>3.3.0</version>
<version>3.3.1</version>
<releaseNotes>
- .NET 8 implementation of FabricObserver. This version is built for .NET 8 and SF Runtime >= 9.1 (Self-Contained FO builds only). If you have deployed SF Runtime version >= 10.1 Cumulative Update 3.0 (CU3), then you can deploy the framework-dependent release build for the target platform (Windows or Linux). If you are not running SF Runtime version >= 10.1 CU3, then you must deploy the Self-Contained release build for the target platform (Windows or Linux). **If you can't upgrade to .NET 8 yet, then do not upgrade to this version.**
- The FabricObserverWebAPI project has been completely removed and all related usage in observers removed.
- FabricSystemObserver no longer monitors Windows Event Logs. Setting the related configuration values will have no effect.
- Fixed a bug in AppObserver that led to AppObserver crashing on Linux when checking for app memory usage.
</releaseNotes>
<authors>Microsoft</authors>
<license type="expression">MIT</license>
Expand Down
4 changes: 2 additions & 2 deletions FabricObserver/FabricObserver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<TargetLatestRuntimePatch>True</TargetLatestRuntimePatch>
<Copyright>Copyright © 2024</Copyright>
<Product>FabricObserver</Product>
<Version>3.3.0</Version>
<FileVersion>3.3.0</FileVersion>
<Version>3.3.1</Version>
<FileVersion>3.3.1</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsServiceFabricServiceProject>true</IsServiceFabricServiceProject>
<StartupObject>FabricObserver.Program</StartupObject>
Expand Down
6 changes: 3 additions & 3 deletions FabricObserver/Observers/AppObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public override async Task ObserveAsync(CancellationToken token)
}
catch (Exception e) when (e is not OutOfMemoryException)
{
ObserverLogger.LogError($"Unhandled exception in ObserveAsync: {e.Message}");
ObserverLogger.LogError($"Unhandled exception in ObserveAsync: {e}");
throw;
}
finally
Expand Down Expand Up @@ -2492,7 +2492,7 @@ any processes that the service process (parent) created/spawned (children). */
}

// Memory - Private Bytes MB. Windows-only.
if (IsWindows && application.ErrorPrivateBytesMb > 0 || application.WarningPrivateBytesMb > 0)
if (IsWindows && (application.ErrorPrivateBytesMb > 0 || application.WarningPrivateBytesMb > 0))
{
_ = AllAppPrivateBytesDataMb.TryAdd(id, new FabricResourceUsageData<float>(ErrorWarningProperty.PrivateBytesMb, id, 1, false, EnableConcurrentMonitoring));
}
Expand All @@ -2504,7 +2504,7 @@ any processes that the service process (parent) created/spawned (children). */
}

// Memory - Private Bytes (Percent). Windows-only.
if (IsWindows && application.ErrorPrivateBytesPercent > 0 || application.WarningPrivateBytesPercent > 0)
if (IsWindows && (application.ErrorPrivateBytesPercent > 0 || application.WarningPrivateBytesPercent > 0))
{
_ = AllAppPrivateBytesDataPercent.TryAdd(id, new FabricResourceUsageData<double>(ErrorWarningProperty.PrivateBytesPercent, id, 1, false, EnableConcurrentMonitoring));
}
Expand Down
2 changes: 1 addition & 1 deletion FabricObserver/Observers/ObserverManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private List<ObserverBase> Observers
private CancellationTokenSource linkedSFRuntimeObserverTokenSource;

// Folks often use their own version numbers. This is for internal diagnostic telemetry.
private const string InternalVersionNumber = "3.3.0";
private const string InternalVersionNumber = "3.3.1";

private static FabricClient FabricClientInstance => FabricClientUtilities.FabricClientSingleton;

Expand Down
6 changes: 3 additions & 3 deletions FabricObserver/PackageRoot/Data/Plugins/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Note that the observer API lives in its own library, FabricObserver.Extensibilit
1. Create a new .NET 6 Library project.

2. Install the same version of the Microsoft.ServiceFabricApps.FabricObserver.Extensibility nupkg from https://www.nuget.org/profiles/ServiceFabricApps as the version of FabricObserver you are deploying.
E.g., 3.3.0 if you are going to deploy FO 3.3.0.
NOTE: You can also consume the entire FabricObserver 3.3.0 nupkg to build your plugin. Please see the SampleObserverPlugin project's csproj file for more information.
E.g., 3.3.1 if you are going to deploy FO 3.3.1.
NOTE: You can also consume the entire FabricObserver 3.3.1 nupkg to build your plugin. Please see the SampleObserverPlugin project's csproj file for more information.

3. Write an observer!

Expand Down Expand Up @@ -68,5 +68,5 @@ cd C:\Users\me\source\repos\service-fabric-observer
./Build-FabricObserver
./Build-NugetPackages

The output from the above commands contains FabricObserver platform-specific nupkgs and a package you have to use for plugin authoring named Microsoft.ServiceFabricApps.FabricObserver.Extensibility.3.3.0.nupkg. Nupkg files from above command would be located in
The output from the above commands contains FabricObserver platform-specific nupkgs and a package you have to use for plugin authoring named Microsoft.ServiceFabricApps.FabricObserver.Extensibility.3.3.1.nupkg. Nupkg files from above command would be located in
C:\Users\me\source\repos\service-fabric-observer\bin\release\FabricObserver\Nugets.
8 changes: 4 additions & 4 deletions FabricObserver/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="FabricObserverPkg"
Version="3.3.0"
Version="3.3.1"
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 @@ -9,7 +9,7 @@
This name must match the string used in RegisterServiceType call in Program.cs. -->
<StatelessServiceType ServiceTypeName="FabricObserverType" />
</ServiceTypes>
<CodePackage Name="Code" Version="3.3.0">
<CodePackage Name="Code" Version="3.3.1">
<EntryPoint>
<ExeHost>
<Program>FabricObserver</Program>
Expand All @@ -19,10 +19,10 @@

<!-- 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="3.3.0" />
<ConfigPackage Name="Config" Version="3.3.1" />

<!-- Data package is the contents of the Data directory under PackageRoot that contains an
independently-updateable and versioned custom data for your service.
Observer plugin dlls must live in this folder, in a child folder named Plugins. -->
<DataPackage Name="Data" Version="3.3.0" />
<DataPackage Name="Data" Version="3.3.1" />
</ServiceManifest>
8 changes: 4 additions & 4 deletions FabricObserver/PackageRoot/ServiceManifest_linux.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="FabricObserverPkg"
Version="3.3.0"
Version="3.3.1"
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="3.3.0">
<CodePackage Name="Code" Version="3.3.1">
<SetupEntryPoint>
<ExeHost>
<Program>setcaps.sh</Program>
Expand All @@ -27,10 +27,10 @@

<!-- 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="3.3.0" />
<ConfigPackage Name="Config" Version="3.3.1" />

<!-- Data package is the contents of the Data directory under PackageRoot that contains an
independently-updateable and versioned custom data for your service.
Observer plugin dlls must live in this folder, in a child folder named Plugins. -->
<DataPackage Name="Data" Version="3.3.0" />
<DataPackage Name="Data" Version="3.3.1" />
</ServiceManifest>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- You can try the XML diff/merge tool XmlDiffPatchSF (located in this repo) to make upgrading your base configurations to the latest version much easier. -->
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="FabricObserverType" ApplicationTypeVersion="3.3.0" 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="FabricObserverType" ApplicationTypeVersion="3.3.1" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<!-- ObserverManager Configuration -->
<!-- FO's Observer loop will sleep for at least 30s, regardless of this setting. So, setting to 0 to 29 would mean FO will sleep for 30 seconds between observer loop iterations. -->
Expand Down Expand Up @@ -251,7 +251,7 @@
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="FabricObserverPkg" ServiceManifestVersion="3.3.0" />
<ServiceManifestRef ServiceManifestName="FabricObserverPkg" ServiceManifestVersion="3.3.1" />
<ConfigOverrides>
<ConfigOverride Name="Config">
<Settings>
Expand Down
Loading
Loading