Supported Agent Configuration Options

Below is the full list of supported configurations you can set to customize the agent behavior, please take some time to read the descriptions for what they can achieve.

Usage: (Pass in intrusive setup)

from skywalking import config, agent
config.init(YourConfiguration=YourValue))
agent.start()

Usage: (Pass by environment variables)

export SW_AGENT_YourConfiguration=YourValue

Agent Core Configuration Options

ConfigurationEnvironment VariableTypeDefault ValueDescription
collector_addressSW_AGENT_COLLECTOR_ADDRESS<class ‘str’>oap_host:oap_portThe backend OAP server address, 11800 is default OAP gRPC port, 12800 is HTTP, Kafka ignores this option and uses kafka_bootstrap_servers option. This option should be changed accordingly with selected protocol
protocolSW_AGENT_PROTOCOL<class ‘str’>grpcThe protocol to communicate with the backend OAP, http, grpc or kafka, we highly suggest using grpc in production as it's well optimized than http. The kafka protocol provides an alternative way to submit data to the backend.
service_nameSW_AGENT_SERVICE_NAME<class ‘str’>Python Service NameThe name of your awesome Python service
service_instanceSW_AGENT_SERVICE_INSTANCE<class ‘str’>str(uuid.uuid1()).replace(‘-’, '')The name of this particular awesome Python service instance
namespaceSW_AGENT_NAMESPACE<class ‘str’>The agent namespace of the Python service (available as tag and the suffix of service name)
kafka_bootstrap_serversSW_AGENT_KAFKA_BOOTSTRAP_SERVERS<class ‘str’>localhost:9092A list of host/port pairs to use for establishing the initial connection to your Kafka cluster. It is in the form of host1:port1,host2:port2,... (used for Kafka reporter protocol)
kafka_namespaceSW_AGENT_KAFKA_NAMESPACE<class ‘str’>The kafka namespace specified by OAP side SW_NAMESPACE, prepends the following kafka topic names with a -.
kafka_topic_managementSW_AGENT_KAFKA_TOPIC_MANAGEMENT<class ‘str’>skywalking-managementsSpecifying Kafka topic name for service instance reporting and registering, this should be in sync with OAP
kafka_topic_segmentSW_AGENT_KAFKA_TOPIC_SEGMENT<class ‘str’>skywalking-segmentsSpecifying Kafka topic name for Tracing data, this should be in sync with OAP
kafka_topic_logSW_AGENT_KAFKA_TOPIC_LOG<class ‘str’>skywalking-logsSpecifying Kafka topic name for Log data, this should be in sync with OAP
kafka_topic_meterSW_AGENT_KAFKA_TOPIC_METER<class ‘str’>skywalking-metersSpecifying Kafka topic name for Meter data, this should be in sync with OAP
kafka_reporter_custom_configurationsSW_AGENT_KAFKA_REPORTER_CUSTOM_CONFIGURATIONS<class ‘str’>The configs to init KafkaProducer, supports the basic arguments (whose type is either str, bool, or int) listed here This config only works from env variables, each one should be passed in SW_AGENT_KAFKA_REPORTER_CONFIG_<KEY_NAME>
force_tlsSW_AGENT_FORCE_TLS<class ‘bool’>FalseUse TLS for communication with SkyWalking OAP (no cert required)
authenticationSW_AGENT_AUTHENTICATION<class ‘str’>The authentication token to verify that the agent is trusted by the backend OAP, as for how to configure the backend, refer to the yaml.
logging_levelSW_AGENT_LOGGING_LEVEL<class ‘str’>INFOThe level of agent self-logs, could be one of CRITICAL, FATAL, ERROR, WARN(WARNING), INFO, DEBUG. Please turn on debug if an issue is encountered to find out what's going on

Agent Core Danger Zone

ConfigurationEnvironment VariableTypeDefault ValueDescription
heartbeat_periodSW_AGENT_HEARTBEAT_PERIOD<class ‘int’>30The agent will exchange heartbeat message with SkyWalking OAP backend every period seconds
collector_properties_report_period_factorSW_AGENT_COLLECTOR_PROPERTIES_REPORT_PERIOD_FACTOR<class ‘int’>10The agent will report service instance properties every factor * heartbeat period seconds default: 10*30 = 300 seconds
instance_properties_jsonSW_AGENT_INSTANCE_PROPERTIES_JSON<class ‘str’>A custom JSON string to be reported as service instance properties, e.g. {"key": "value"}
experimental_fork_supportSW_AGENT_EXPERIMENTAL_FORK_SUPPORT<class ‘bool’>FalseThe agent will try to restart itself in any os.fork()-ed child process. Important Note: it's not suitable for short-lived processes as each one will introduce overhead and create a new instance in SkyWalking dashboard in format of service_instance-child-<pid> (TODO)
queue_timeoutSW_AGENT_QUEUE_TIMEOUT<class ‘int’>1DANGEROUS - This option controls the interval of each bulk report from telemetry data queues Do not modify unless you have evaluated its impact given your service load.

SW_PYTHON Auto Instrumentation CLI

ConfigurationEnvironment VariableTypeDefault ValueDescription
sw_python_bootstrap_propagateSW_AGENT_SW_PYTHON_BOOTSTRAP_PROPAGATE<class ‘bool’>FalseSpecial: can only be passed via environment. This config controls the child process agent bootstrap behavior in sw-python CLI, if set to False, a valid child process will not boot up a SkyWalking Agent. Please refer to the CLI Guide for details.

Trace Reporter Configurations

ConfigurationEnvironment VariableTypeDefault ValueDescription
trace_reporter_max_buffer_sizeSW_AGENT_TRACE_REPORTER_MAX_BUFFER_SIZE<class ‘int’>10000The maximum queue backlog size for sending the segment data to backend, segments beyond this are silently dropped
trace_ignore_pathSW_AGENT_TRACE_IGNORE_PATH<class ‘str’>You can setup multiple URL path patterns, The endpoints match these patterns wouldn't be traced. the current matching rules follow Ant Path match style , like /path/*, /path/**, /path/?.
ignore_suffixSW_AGENT_IGNORE_SUFFIX<class ‘str’>.jpg,.jpeg,.js,.css,.png,.bmp,.gif,.ico,.mp3,.mp4,.html,.svgIf the operation name of the first span is included in this set, this segment should be ignored.
correlation_element_max_numberSW_AGENT_CORRELATION_ELEMENT_MAX_NUMBER<class ‘int’>3Max element count of the correlation context.
correlation_value_max_lengthSW_AGENT_CORRELATION_VALUE_MAX_LENGTH<class ‘int’>128Max value length of correlation context element.

Profiling Configurations

ConfigurationEnvironment VariableTypeDefault ValueDescription
profiler_activeSW_AGENT_PROFILER_ACTIVE<class ‘bool’>TrueIf True, Python agent will enable profiler when user create a new profiling task.
get_profile_task_intervalSW_AGENT_GET_PROFILE_TASK_INTERVAL<class ‘int’>20The number of seconds between two profile task query.
profile_max_parallelSW_AGENT_PROFILE_MAX_PARALLEL<class ‘int’>5The number of parallel monitor segment count.
profile_durationSW_AGENT_PROFILE_DURATION<class ‘int’>10The maximum monitor segment time(minutes), if current segment monitor time out of limit, then stop it.
profile_dump_max_stack_depthSW_AGENT_PROFILE_DUMP_MAX_STACK_DEPTH<class ‘int’>500The number of max dump thread stack depth
profile_snapshot_transport_buffer_sizeSW_AGENT_PROFILE_SNAPSHOT_TRANSPORT_BUFFER_SIZE<class ‘int’>50The number of snapshot transport to backend buffer size

Log Reporter Configurations

ConfigurationEnvironment VariableTypeDefault ValueDescription
log_reporter_activeSW_AGENT_LOG_REPORTER_ACTIVE<class ‘bool’>TrueIf True, Python agent will report collected logs to the OAP or Satellite. Otherwise, it disables the feature.
log_reporter_safe_modeSW_AGENT_LOG_REPORTER_SAFE_MODE<class ‘bool’>FalseIf True, Python agent will filter out HTTP basic auth information from log records. By default, it disables the feature due to potential performance impact brought by regular expression
log_reporter_max_buffer_sizeSW_AGENT_LOG_REPORTER_MAX_BUFFER_SIZE<class ‘int’>10000The maximum queue backlog size for sending log data to backend, logs beyond this are silently dropped.
log_reporter_levelSW_AGENT_LOG_REPORTER_LEVEL<class ‘str’>WARNINGThis config specifies the logger levels of concern, any logs with a level below the config will be ignored.
log_reporter_ignore_filterSW_AGENT_LOG_REPORTER_IGNORE_FILTER<class ‘bool’>FalseThis config customizes whether to ignore the application-defined logger filters, if True, all logs are reported disregarding any filter rules.
log_reporter_formattedSW_AGENT_LOG_REPORTER_FORMATTED<class ‘bool’>TrueIf True, the log reporter will transmit the logs as formatted. Otherwise, puts logRecord.msg and logRecord.args into message content and tags(argument.n), respectively. Along with an exception tag if an exception was raised. Only applies to logging module.
log_reporter_layoutSW_AGENT_LOG_REPORTER_LAYOUT<class ‘str’>%(asctime)s [%(threadName)s] %(levelname)s %(name)s - %(message)sThe log reporter formats the logRecord message based on the layout given. Only applies to logging module.
cause_exception_depthSW_AGENT_CAUSE_EXCEPTION_DEPTH<class ‘int’>10This configuration is shared by log reporter and tracer. This config limits agent to report up to limit stacktrace, please refer to Python traceback for more explanations.

Meter Reporter Configurations

ConfigurationEnvironment VariableTypeDefault ValueDescription
meter_reporter_activeSW_AGENT_METER_REPORTER_ACTIVE<class ‘bool’>TrueIf True, Python agent will report collected meters to the OAP or Satellite. Otherwise, it disables the feature.
meter_reporter_max_buffer_sizeSW_AGENT_METER_REPORTER_MAX_BUFFER_SIZE<class ‘int’>10000The maximum queue backlog size for sending meter data to backend, meters beyond this are silently dropped.
meter_reporter_periodSW_AGENT_METER_REPORTER_PERIOD<class ‘int’>20The interval in seconds between each meter data report
pvm_meter_reporter_activeSW_AGENT_PVM_METER_REPORTER_ACTIVE<class ‘bool’>TrueIf True, Python agent will report collected Python Virtual Machine (PVM) meters to the OAP or Satellite. Otherwise, it disables the feature.

Plugin Related configurations

ConfigurationEnvironment VariableTypeDefault ValueDescription
disable_pluginsSW_AGENT_DISABLE_PLUGINS<class ‘list’>['']The name patterns in comma-separated pattern, plugins whose name matches one of the pattern won't be installed
http_params_length_thresholdSW_AGENT_HTTP_PARAMS_LENGTH_THRESHOLD<class ‘int’>1024When COLLECT_HTTP_PARAMS is enabled, how many characters to keep and send to the OAP backend, use negative values to keep and send the complete parameters, NB. this config item is added for the sake of performance.
http_ignore_methodSW_AGENT_HTTP_IGNORE_METHOD<class ‘str’>Comma-delimited list of http methods to ignore (GET, POST, HEAD, OPTIONS, etc...)
sql_parameters_lengthSW_AGENT_SQL_PARAMETERS_LENGTH<class ‘int’>0The maximum length of the collected parameter, parameters longer than the specified length will be truncated, length 0 turns off parameter tracing
pymongo_trace_parametersSW_AGENT_PYMONGO_TRACE_PARAMETERS<class ‘bool’>FalseIndicates whether to collect the filters of pymongo
pymongo_parameters_max_lengthSW_AGENT_PYMONGO_PARAMETERS_MAX_LENGTH<class ‘int’>512The maximum length of the collected filters, filters longer than the specified length will be truncated
elasticsearch_trace_dslSW_AGENT_ELASTICSEARCH_TRACE_DSL<class ‘bool’>FalseIf true, trace all the DSL(Domain Specific Language) in ElasticSearch access, default is false
flask_collect_http_paramsSW_AGENT_FLASK_COLLECT_HTTP_PARAMS<class ‘bool’>FalseThis config item controls that whether the Flask plugin should collect the parameters of the request.
sanic_collect_http_paramsSW_AGENT_SANIC_COLLECT_HTTP_PARAMS<class ‘bool’>FalseThis config item controls that whether the Sanic plugin should collect the parameters of the request.
django_collect_http_paramsSW_AGENT_DJANGO_COLLECT_HTTP_PARAMS<class ‘bool’>FalseThis config item controls that whether the Django plugin should collect the parameters of the request.
fastapi_collect_http_paramsSW_AGENT_FASTAPI_COLLECT_HTTP_PARAMS<class ‘bool’>FalseThis config item controls that whether the FastAPI plugin should collect the parameters of the request.
bottle_collect_http_paramsSW_AGENT_BOTTLE_COLLECT_HTTP_PARAMS<class ‘bool’>FalseThis config item controls that whether the Bottle plugin should collect the parameters of the request.
celery_parameters_lengthSW_AGENT_CELERY_PARAMETERS_LENGTH<class ‘int’>512The maximum length of celery functions parameters, longer than this will be truncated, 0 turns off