- 1 Minute to read
- Print
- DarkLight
- PDF
Stackify.json Best Practices
- 1 Minute to read
- Print
- DarkLight
- PDF
The Stackify.json
is a configuration file that lives in your application's directory. At a minimum the file will contain the App Name of the application you are wanting to monitor. This file is used by the .NET profiler for a number of different purposes that will be documented in this article below.
File Placement
The specific location of the Stackify.json file will be dependent on the app type. In some scenarios your application will be only be profiled if this configuration exists (such as .NET core apps or Windows Services), so please reference where to place the Stackify.json
file for your particular setup.
Web Applications
In most cases the Stackify.json
should be placed in the same location as your web.config file. It is also best practice to add the Stackify.json
file to your project and make sure that the file is always copied to the Output Directory. In Visual Studio, for example, mark it as "Copy to Output Directory" and set it as "Copy Always".
Console Apps
In most cases the Stackify.json
should be placed in the same folder as the main executable for .NET Framework console applications or the folder of the root .dll
or .exe
file for .NET Core applications (not embedded in IIS).
Setting App Name and Environment Name
"AppName": "Example App Name",
"Environment": "Example Environment Name"
Custom Instrumentation
"Instrumentation": [
{
"Assembly": "MyLib",
"Class": "MyApp.MyLib.MyClass",
"Method": "MyMethod"
}
]
See here to learn more about the different types of Custom Instrumentation you can add to your application.
Setting Maximum Frame Count
To protect against excessive memory usage, we truncate traces at 5,000 frames. If this limit is reached, you may see a message like this in the trace viewer of Retrace:
This limit can be configurable to exceed the 5,000 frame count limit via a Stackify.json setting:
"MaximumFrameCount": 6000
Be aware that this could lead to increased memory usage or cause slow downs in the agent
Disabling Profiling
"DisableTracing": true
Example Stackify.json Format
{
"AppName": "Example App Name",
"Environment": "Example Environment Name",
"Instrumentation": [
{
"Assembly": "MyLib",
"Class": "MyApp.MyLib.MyClass",
"Method": "MyMethod"
}
],
"DisableTracing": true
}