IBM Performance Management

Python agent: Runtime configuration

You can change the behavior of each Python agent by changing its runtime configuration in its configuration file.

Runtime configuration file

Each Django application has its own runtime configuration file, which is in the temporary folder for the agent: install_dir/tmp/kpg/plugin_conf_numeric_string.json where install_dir is the Python agent installation directory. The default installation directory is /opt/ibm/apm/agent.

Every minute, every monitoring middleware component reads its own runtime configuration and changes its behavior accordingly. A runtime configuration file includes the following items:
"filters":
[
{
"pattern" : "GET/polls/get_infinite/.*",
"to" : "GET/polls/infinite/123"
}
7
],
"maxRequestSize": 200,
"logLevel": "error"

URL filters

A URL filter aggregates different URLs into one URL. Some websites implement the same function with different or unique URL paths. For example, the following requests might be answered by the same back end routine on the server side:
/polls/1/
/polls/2/

/polls/45/
From the resource monitoring or performance diagnosis view, you are not required to distinguish among those requests. You can write a JSON format regular expression and assign the expression to a filter as its pattern. Usually, a pattern for a filter includes an HTTP method and a regular expression for matching a particular URL path name. Then, you can assign a uniform string as its new URL path. Similarly, in this uniform string, include the same method and a static string to identify this kind of request. The following example shows a sample filter for the requests in URL filters:
{
pattern : GET/polls/[09]+/,
to : GET/polls/n/
}

With this filter, the sample requests are aggregated as one. The response time, count, and traffic are calculated together. The profiler report is generated for one request and for a collection interval.

You can define as many filters as you require and put them in the array. The first matched filter is used for one request.

Note: Configure the URL filters to map multiple requests with the same patterns to one request to avoid the issue where some requests with the same pattern cannot find matching profile information.

Max Request Size

In each Apache working process, for 1 minute, the monitoring middleware remembers as many kinds of URLs as designated by Max Request Size.

Trace Level

Each monitoring middleware component can log messages to its own log file. You can find the messages in the following temp folder: /tmp/kpglogs/kpg_ParentProcessId_ProcessId.log

These log files are rotated if their size reaches 10 MB. One rotation is saved. If you have multiple Django projects, the log file contains messages for all projects.