Profiling Multiple Products Hosted on a Single IIS Server
Problem
When hosting multiple products on a single IIS server, how can you configure dedicated Sealights environment variables (SL_LABID, SL_BUILDSESSIONFILE) for each product, given that IIS (WAS/W3SVC) registry entries are shared across all applications?
Solution
Use the SL_COVERAGECOLLECTOR_PREDEFINEDSESSIONS variable to define a preconfigured sessions file that maps each product to its specific Sealights parameters based on the application pool.
Example Setup
Let's say your IIS server runs two apps:
App Path
C:\inetpub\wwwroot\StockManager
C:\inetpub\wwwroot\OnlineShop
IIS App Pool
StockManagerAppPool
OnlineShopAppPool
Lab ID
StockManager_EnvQA1
OnlineShop_EnvUAT1
BSID File location
C:\inetpub\wwwroot\StockManager\buildSessionId.txt
C:\inetpub\wwwroot\OnlineShop\buildSessionId.txt
Configuration
You'll have to use the following setup:
Create the sessions JSON file
Create a collector-sessions.json file with the below content :
{
"sessions": [
{
"session": {
"buildSessionId": "C:\\inetpub\\wwwroot\\StockManager\\buildSessionId.txt",
"labId": "StockManager_EnvQA1"
},
"coverageCollector": {
"applicationPool": "StockManagerAppPool"
}
},
{
"session": {
"buildSessionId": "C:\\inetpub\\wwwroot\\OnlineShop\\buildSessionId.txt",
"labId": "OnlineShop_EnvUAT1"
},
"coverageCollector": {
"applicationPool": "OnlineShopAppPool"
}
}
]
}Refer to this file in the IIS Env Vars
Assuming your current installation path is in the C:\Sealights directory (update the below according to your environment):
COR_ENABLE_PROFILING=1
COR_PROFILER={01CA2C22-DC03-4FF5-8350-59E32A3536BA}
COR_PROFILER_PATH=C:\Sealights\Agent\SL.DotNet.ProfilerLib.Windows_x64.dll
COR_PROFILER_PATH_32=C:\Sealights\Agent\SL.DotNet.ProfilerLib.Windows_x86.dll
COR_PROFILER_PATH_64=C:\Sealights\Agent\SL.DotNet.ProfilerLib.Windows_x64.dll
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={01CA2C22-DC03-4FF5-8350-59E32A3536BA}
CORECLR_PROFILER_PATH_32=C:\Sealights\Agent\SL.DotNet.ProfilerLib.Windows_x86.dll
CORECLR_PROFILER_PATH_64=C:\Sealights\Agent\SL.DotNet.ProfilerLib.Windows_x64.dll
SL_PROFILER_INITIALIZECOLLECTOR=1
SL_TOKENFILE=C:\Sealights\sltoken.txt
SL_COVERAGECOLLECTOR_PREDEFINEDSESSIONS=C:\Sealights\collector-sessions.json
SL_LOGLEVEL=Debug
SL_LOGGING_TOFILE=true
SL_LOGDIR=C:\Sealights\LogsConfigure the rest as usual
See Configuring the Profiler-Initiated Collector > Specific configurations > IIS/Windows
When these steps are complete, new entries will appear in Cockpit > Live Agents Monitor: a testListener and an entity named Profiler, for each entry listed in the session file with each version details and the IIS AppPool shown in the Tag column
Last updated
Was this helpful?

