Supported Environment Variables

Below is the full list of supported environment variables you can set to customize the agent behavior, please read the descriptions for what they can achieve.

Environment VariableDescriptionDefault
SW_AGENT_NAMEThe name of the Python servicePython Service Name
SW_AGENT_INSTANCEThe name of the Python service instanceRandomly generated
SW_AGENT_NAMESPACEThe agent namespace of the Python serviceunset
SW_AGENT_COLLECTOR_BACKEND_SERVICESThe backend OAP server address127.0.0.1:11800
SW_AGENT_FORCE_TLSUse TLS for communication with server (no cert required)False
SW_AGENT_PROTOCOLThe 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.grpc
SW_AGENT_AUTHENTICATIONThe authentication token to verify that the agent is trusted by the backend OAP, as for how to configure the backend, refer to the yaml.unset
SW_AGENT_LOGGING_LEVELThe logging level, could be one of CRITICAL, FATAL, ERROR, WARN(WARNING), INFO, DEBUGINFO
SW_AGENT_DISABLE_PLUGINSThe name patterns in CSV pattern, plugins whose name matches one of the pattern won't be installed''
SW_AGENT_MAX_BUFFER_SIZEThe maximum queue backlog size for sending the segment data to backend, segments beyond this are silently dropped'10000'
SW_HTTP_IGNORE_METHODComma-delimited list of http methods to ignore (GET, POST, HEAD, OPTIONS, etc...)``
SW_SQL_PARAMETERS_LENGTHThe maximum length of the collected parameter, parameters longer than the specified length will be truncated, length 0 turns off parameter tracing0
SW_PYMONGO_TRACE_PARAMETERSIndicates whether to collect the filters of pymongoFalse
SW_PYMONGO_PARAMETERS_MAX_LENGTHThe maximum length of the collected filters, filters longer than the specified length will be truncated512
SW_IGNORE_SUFFIXIf the operation name of the first span is included in this set, this segment should be ignored..jpg,.jpeg,.js,.css,.png,.bmp,.gif,.ico,.mp3,.mp4,.html,.svg
SW_FLASK_COLLECT_HTTP_PARAMSThis config item controls that whether the Flask plugin should collect the parameters of the request.false
SW_DJANGO_COLLECT_HTTP_PARAMSThis config item controls that whether the Django plugin should collect the parameters of the request.false
SW_HTTP_PARAMS_LENGTH_THRESHOLDWhen 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.1024
SW_CORRELATION_ELEMENT_MAX_NUMBERMax element count of the correlation context.3
SW_CORRELATION_VALUE_MAX_LENGTHMax value length of correlation context element.128
SW_TRACE_IGNOREThis config item controls that whether the trace should be ignorefalse
SW_TRACE_IGNORE_PATHYou 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/?.''
SW_ELASTICSEARCH_TRACE_DSLIf true, trace all the DSL(Domain Specific Language) in ElasticSearch access, default is falsefalse
SW_KAFKA_REPORTER_BOOTSTRAP_SERVERSA list of host/port pairs to use for establishing the initial connection to the Kafka cluster. It is in the form host1:port1,host2:port2,...localhost:9092
SW_KAFKA_REPORTER_TOPIC_MANAGEMENTSpecifying Kafka topic name for service instance reporting and registering.skywalking-managements
SW_KAFKA_REPORTER_TOPIC_SEGMENTSpecifying Kafka topic name for Tracing data.skywalking-segments
SW_KAFKA_REPORTER_TOPIC_LOGSpecifying Kafka topic name for Log data.skywalking-logs
SW_KAFKA_REPORTER_CONFIG_keyThe configs to init KafkaProducer. it support the basic arguments (whose type is either str, bool, or int) listed hereunset
SW_CELERY_PARAMETERS_LENGTHThe maximum length of celery functions parameters, longer than this will be truncated, 0 turns off512
SW_AGENT_PROFILE_ACTIVEIf True, Python agent will enable profile when user create a new profile task. Otherwise disable profile.True
SW_PROFILE_TASK_QUERY_INTERVALThe number of seconds between two profile task query.20
SW_AGENT_PROFILE_MAX_PARALLELThe number of parallel monitor segment count.5
SW_AGENT_PROFILE_DURATIONThe maximum monitor segment time(minutes), if current segment monitor time out of limit, then stop it.10
SW_AGENT_PROFILE_DUMP_MAX_STACK_DEPTHThe number of max dump thread stack depth500
SW_AGENT_PROFILE_SNAPSHOT_TRANSPORT_BUFFER_SIZEThe number of snapshot transport to backend buffer size50
SW_AGENT_LOG_REPORTER_ACTIVEIf True, Python agent will report collected logs to the OAP or Satellite. Otherwise, it disables the feature.False
SW_AGENT_LOG_REPORTER_SAFE_MODEIf True, Python agent will filter out HTTP basic auth information from log records. Otherwise, it disables the feature due to potential performance impact brought by regular expressionFalse
SW_AGENT_LOG_REPORTER_BUFFER_SIZEThe maximum queue backlog size for sending log data to backend, logs beyond this are silently dropped.10000
SW_AGENT_LOG_REPORTER_LEVELThis config specifies the logger levels of concern, any logs with a level below the config will be ignored.WARNING
SW_AGENT_LOG_REPORTER_IGNORE_FILTERThis config customizes whether to ignore the application-defined logger filters, if True, all logs are reported disregarding any filter rules.False
SW_AGENT_LOG_REPORTER_FORMATTEDIf 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.True
SW_AGENT_LOG_REPORTER_LAYOUTThe log reporter formats the logRecord message based on the layout given.%(asctime)s [%(threadName)s] %(levelname)s %(name)s - %(message)s
SW_AGENT_CAUSE_EXCEPTION_DEPTHThis config limits agent to report up to limit stacktrace, please refer to Python traceback for more explanations.10
SW_PYTHON_BOOTSTRAP_PROPAGATEThis 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.unset
SW_FASTAPI_COLLECT_HTTP_PARAMSThis config item controls that whether the FastAPI plugin should collect the parameters of the request.false