App Parameters
App Parameters allows you to ingest any metric into your application context. This capability enables the platform to observe and monitor crucial Key Performance Indicators (KPIs) that may not be captured by default monitoring settings.
With App Parameters, you can monitor the:
- Size, numeric value, or frequency of a variable.
- Size or frequency of an operation in an application.
Let's say a simple web request involves an API call, a database (DB) operation, and a cache hit; a single request can invoke multiple resources, and multiple users can invoke multiple requests at once. In these instances, you can figure out how often the API was called, as well as the number of times the DB operation took place during a particular time interval. This helps you assess if the CPU or memory is being overloaded and how this is affecting your app performance for the given time interval.
With real-world applications, the App Parameters feature comes in handy when monitoring the frequency of hits to DB calls, service calls, or user-defined framework calls. Based on the report in App Parameters, you can troubleshoot performance degradation caused by an overload of hits.
Get started with App Parameters:
- Operations involved
- Installation instructions for .NET and .NET Core applications
- Installation instructions for Java applications
- Installation instructions for PHP applications
- Instructions for Node.js applications
- View App Parameters
Operations involved:
1. Sum
- The sum of all values passed in a specific interval for a parameter.
2.Average
- The average value passed in a specific interval for a parameter.
Every parameter will be sent with the below metrics to track its frequency:
Sum:
1.Param Name:
- The parameter name provided by the user in the application.
2.Total Value:
- The aggregated value for the corresponding parameter on a particular interval.
Average:
1.Param Name:
- The parameter name provided by the user in the application.
2.Total Value:
- The aggregated value for the corresponding parameter during a particular interval.
3.Minimum Value:
- The minimum value captured in that particular interval.
4.Maximum Value:
- The maximum value captured in that particular interval.
5.Total Count:
- The total number of hits.
App Parameter APIs are available for .NET and Java agents. Follow the instructions below to get started.
For .NET and .NET Core applications:
- Install APM Insight .NET agent or APM Insight .NET Core agent based on your application environment.
- Download or reference the package Site24x7.Agent.Api from the NuGet package manager to your application project.
Note
The API has a class named Site24x7.Agent.Api to track the performance of application code.
Sum
Sum of values passed in a specific interval for a parameter. If the sum is an empty value, it will be incremented by 1.
Site24x7.Agent.Api.Increment("keyName");
Site24x7.Agent.Api.Increment("keyName", value);
Average
Average of values passed for a parameter in a specific interval.
Site24x7.Agent.Api.Average("keyName", value);
Parameter Name |
Description |
---|---|
keyName |
The name of the app parameter you want to monitor. |
incrementalValue |
The App parameter key will be incremented by this value. |
averagingValue |
The App parameter key will be averaged by this value. |
4. Add the above code snippets wherever required:
Example:
5. Publish the application to start tracking the parameters.
For Java applications:
- Install the APM Insight Java agent
- Ensure you meet the prerequisites. Bundle the API jar found in your application build path (apminsight-javaagent-api.jar). The preferred location is WEB-INF/lib.
- Add the code snippet below wherever required.
Sum
CustomMetric.increment("key_name")
Value for the key will be incremented by 1. Key will be cleared on every agent polling interval.
CustomMetric.increment("key_name", value)
Value for the key will be increment by the specified value. Key will be cleared on every agent polling interval.
Average
CustomMetric.average("key_name", value)
Value for the key will be aggregated and its count will be collected by the agent and pushed to Site24x7's servers.
Example:
private void generateReport(String type)
{
CustomMetric.increment(type);
// Other app operations
double averageValue = getAverageValue();
CustomMetric.average(type, averageValue);
For PHP applications:
Sum
zpa_app_param_increment(“keyName”);
The value for the key will be incremented by 1. The key will be cleared at every agent polling interval.
zpa_app_param_increment(“keyName”,value);
The specified value will increment the value for the key. The key will be cleared at every agent polling interval.
Average
The average of the values passed for a parameter at a specific interval.
zpa_app_param_avg(“keyName”,value);
To view App Parameters:
- Log in to your Site24x7 account > Your application > App Parameters.
- App Parameters created for operations/variables will be listed on the right, along with the name you have provided and the type of parameter (sum or average).
- Click on the parameter you wish to view; you can create, save, and update views for future reference.