Customizing the Python data collector for IBM Cloud applications
You can add environment variables in the IBM® Cloud user interface (UI) to customize the monitoring for your IBM Cloud application. Use the following information to add the variables according to your needs.
User-defined environment variables for the Python data collector
You can use the information in the following table to customize Python monitoring on IBM Cloud.
Variable name | Importance | Value | Description |
---|---|---|---|
APM_BM_GATEWAY_URL | Optional |
|
The target on-premises server gateway URL. |
APM_KEYFILE_PSWD | Optional | Encrypted password of the key file | The encrypted key file password that is paired with the key file. If you are a Linux user,
you can use the echo -n <keyfile password> | base64 command
to encrypt your password.Note: Set this variable only when you configured the Gateway to use
HTTPS.
|
APM_KEYFILE_URL | Optional | http://<hosted http server>:<port>/keyfile.p12 | The URL to download the key file. Note: Set this variable only when you configured the Gateway
to use HTTPS.
|
KPG_ENABLE_DEEPDIVE | Optional |
|
Enables or disables the collection of diagnostics data.
If you do not set this variable, diagnostics data are collected. |
KPG_DD_CONFIG_FILE | Optional | File name of the diagnostics monitoring configuration file. | File name of the diagnostics monitoring configuration file. The default file name is
kpg_dd_config.xml. Note: After you customize the settings in this file, you must
put it in the application root directory.
If you do not set this variable, the default configuration file kpg_dd_config.xml in the data collector package is used. |
KPG_DD_APP_PATH | Optional | Path to the Python application. | The path to the Python application or the module for which the data collector collects
diagnostics data. Separate the paths of different Python applications and modules that you want to
monitor with a semi-colon ; .If you do not set this variable, the data collector collects data for requests and the modules that your application use. Data of requests in Python lib are not collected. |
KPG_DD_SECURITY_FILTER | Optional |
|
If you do not set this variable, values (such as the passwords) are masked in SQL statements and parameters are not displayed in group widget Request Context. |
KPG_GC_STATS | Optional | True | All statistical functions of python garbage collection are enabled. When you set this value
to True, it equals running the following command:
To disable KPG_GC_STATS, delete this environment variable. Do not set it to False. Note: Never set
KPG_SAVE_ALL=True in your formal
production environment. It is only for the debug mode. Make sure that enough memory is assigned to
the application. |
KPG_LOG_LEVEL | Optional |
|
|
KPG_LOG_TOCONSOLE | Optional |
|
The log is printed to console and you can see the log by running the command cf logs <appname>. |
KPG_SAVE_ALL | Optional | True | All unreferenced objects are saved into gc.garbage, and you need to
clear gc.garbage every minute (the data collector clears it for you). When the
value is set to True, it equals running the following command:
To disable KPG_SAVE_ALL, delete this environment
variable. Do not set it to False. Note: Never set
KPG_SAVE_ALL=True in your formal production environment. It is only for the debug
mode. Make sure that enough memory is assigned to the application. |