Skip to main content

Agent Configuration

This section mainly discusses the local configuration of the Agent. Tingyun provides a default configuration file tingyun.ini in the installation package (or generated via the generate-config command). This configuration uses the standard Python ini file format. For details, see Configuration file parser.

Note: You need to set the environment variable TINGYUN_CONFIG_FILE for the configuration file to enable the Agent. All options in the configuration file except the license key have default values. To use the Agent properly, the license key must be filled in. For more configuration, see the explanations below.

Configuration Options List

SectionOption (case-sensitive)Notes
tingyunlicense_keyString
enabledBoolean
app_nameString
log_fileString
audit_modeBoolean
log_levelString
sslBoolean
auto_action_namingBoolean
action_tracer.log_sqlBoolean
instance_nameString
tornado_wsgi_adapter_modeBoolean
collectorsString
tingyun:privatehostString
tingyun:privateportInteger
tingyun:proxyproxy_schemeProxy protocol
proxy_hostProxy host
proxy_portProxy port
proxy_userProxy user
proxy_pwdProxy password

Note: Local configuration changes require a restart to take effect.

Configuration Option Details

Tingyun uses the standard ini file format. The section header format is: [sectionName] optionName.

[tingyun] license_key

Function: Account authentication identifier, required. You must fill in this item before using the Agent.

Default: None

Description: If this option is missing or incorrect, the Agent can start normally, but the log will indicate an invalid license and no data will be collected or reported.

[tingyun] enabled

Function: Client switch to enable or disable the Agent.

Default: True. Optional values: True, False, on, off (case-insensitive).

Description: If this option is missing or incorrect, the Agent will use True and enable the Agent by default.

[tingyun] app_name

Function: Name of the monitored application.

Default: Python App

Description: If this option is missing, empty, or incorrect, the value Python App will be used as the application name for reporting data.

The Agent supports multi-application connections. This value can be set to multiple application names separated by English commas.

[tingyun] collectors

Function: Set the collector communication address.

Default: None

Description: If this option is missing or incorrect, the Agent cannot be initialized.

[tingyun] log_file

Function: Specify the file name and path for Agent log output. It is recommended to use an absolute path.

Default: /tmp/tingyun-agent.log. Supports custom system file paths, stdout, stderr.

Description: If this option is missing, empty, or incorrect, the Agent can start normally and log will be output to stderr. If stdout or stderr is specified, output will be redirected to the system standard output.

Due to limitations in Python's log partitioning mechanism, the Agent will output logs to a single log file. Please ensure the user running the application process has write permission to the directory and log file, otherwise output will go to stderr.

[tingyun] log_level

Function: Specify the log level for Agent logs.

Default: INFO. Optional values: NOTSET, DEBUG, INFO, WARNING, WARN, FATAL, ERROR, CRITICAL (case-insensitive).

Description: If this option is missing or incorrect, INFO level will be used by default.

[tingyun] ssl

Function: Specify whether to use http or https protocol for data transmission.

Default: True. Optional values: True, False, on, off (case-insensitive).

Description: If this option is missing or incorrect, True will be used and data will be transmitted using https.

[tingyun] audit_mode

Function: Whether to output all submitted data to the log for audit purposes. False disables audit, True enables it. (This log is output at INFO level.)

Default: False. Optional values: True, False, on, off (case-insensitive).

Description: If this option is missing or incorrect, False will be used and audit mode will be disabled. This part of the log will start with "Agent capture" and be output at info level.

[tingyun] auto_action_naming

Function: Whether to enable automatic transaction naming. If enabled, the URI name will be used as the action name.

Default: True. Optional values: True, False, on, off (case-insensitive).

Description: If this option is missing or incorrect, True will be used and automatic naming will be enabled.

[tingyun] action_tracer.log_sql

Function: When tracing transactions, SQL statements are only written to the local log file and not submitted to the data collection service. (Output at INFO level log)

Default: False. Optional values: True, False, on, off (case-insensitive).

Description: If this option is missing or incorrect, False will be used. This part of the log will start with "Log sql is opened".

[tingyun] urls_merge

Function: When automatic transaction naming is disabled, merge URIs as transaction names.

Default: True. Optional values: True, False, on, off (case-insensitive).

Description:

This parameter is used to enable automatic URL merging. Only when [automatic transaction naming] is disabled and this option is enabled will URL merging take effect. The naming rules are as follows:

  • Except for the character '/', consecutive numbers in the URI will be replaced with '*'.
  • For values in the middle of the URI separated by '/', if the value is a number, it will be replaced with '*'.

[tingyun] verify_certification

Function: Whether to verify the Agent server's website certificate.

Default: False. When SSL encrypted data transmission is enabled, the server certificate is not verified. Optional values: True, False, on, off (case-insensitive).

Description:

If the version of the python package certifi is later than 2015.04.28, the certificate uses sha256 encryption to authenticate the website certificate. However, since the root certificate used by the Agent server's certificate authority uses sha1 encryption, using a version later than this will cause server certificate authentication to fail, resulting in data upload failure. The temporary solution is to disable server certificate authentication.

[tingyun] instance_name

Function: Instance name. Required. You must fill in this item before using the Agent.

Default: None. This parameter represents the instance name.

Description: When configuring, this item is used to specify the instance name. If missing, the Agent cannot start normally.

[tingyun] tornado_wsgi_adapter_mode

Function: Enable tornado wsgi application mode.

Default: false. Supports false, true, on, off (case-insensitive).

Description: When deploying tornado applications with third-party containers (such as gevent, uwsgi), you need to enable this option for the Agent to work properly.

[tingyun:private] host

Note: This option is only needed for private Agents. Regular users do not need to configure this option.

Function: For private deployments, used to configure the internal network server redirection address.

Description: If the configuration file does not have the section [tingyun:private], please add it manually before configuring options such as host.

[tingyun:private] port

Note: This option is only needed for private Agents. Regular users do not need to configure this option!

Function: For private deployments, used to configure the open port for the internal network server redirection address.

[tingyun:exclude] plugins

Function: Configure python packages that do not need to be monitored.

Default: None

Description: Plugins are separated by English commas. Supported package names are shown in Table 4-1-24. Example usage:

[tingyun:exclude]
plugins=mysql,memcahced

[tingyun:proxy] proxy_host

Function: Configure the http/https proxy server host address for the Agent to connect to the external network to report performance data.

Default: None

Description: This configuration can be used with proxy_port, proxy_user, and proxy_pwd. The option supports the format: schame://user:password@host/path.

[tingyun:proxy] proxy_port

Function: Configure the proxy server host port.

Default: None

[tingyun:proxy] proxy_user

Function: Configure the proxy server username.

Default: None

[tingyun:proxy] proxy_pwd

Function: Configure the proxy server password, corresponding to proxy_user.

Default: None

[tingyun:proxy] proxy_scheme

Function: Configure the proxy server data transmission protocol.

Default: http

Environment Variables

TINGYUN_CONFIG_FILE

This environment variable is used to specify the Agent's configuration file. When starting the Agent from the command line, the Agent will automatically look for this variable in the system environment variables and read the configuration file. This variable is case-sensitive.

If the application's startup method is controlled by a shell, it can be embedded in the shell.