Profiling
Profile supports collecting dynamic performance data of applications running in different language environments such as Java/Python, and helps users to view performance problems of CPU, memory and IO.
Configuration¶
At present, DataKit collects profiling data in two ways:
-
Push mode: the DataKit Profile service needs to be opened, and the client actively pushes data to the DataKit
-
Pull method: currently only Go support, need to manually configure relevant information
DataKit Configuration¶
Go to the conf.d/profile
directory under the DataKit installation directory, copy profile.conf.sample
and name it profile.conf
. The configuration file is described as follows:
[[inputs.profile]]
## profile Agent endpoints register by version respectively.
## Endpoints can be skipped listen by remove them from the list.
## Default value set as below. DO NOT MODIFY THESE ENDPOINTS if not necessary.
endpoints = ["/profiling/v1/input"]
## set true to enable election, pull mode only
election = true
## the max allowed size of http request body (of MB), 32MB by default.
body_size_limit_mb = 32 # MB
## set false to stop generating apm metrics from ddtrace output.
generate_metrics = true
## io_config is used to control profiling uploading behavior.
## cache_path set the disk directory where temporarily cache profiling data.
## cache_capacity_mb specify the max storage space (in MiB) that profiling cache can use.
## clear_cache_on_start set whether we should clear all previous profiling cache on restarting Datakit.
## upload_workers set the count of profiling uploading workers.
## send_timeout specify the http timeout when uploading profiling data to dataway.
## send_retry_count set the max retry count when sending every profiling request.
# [inputs.profile.io_config]
# cache_path = "/usr/local/datakit/cache/profile_inputs" # C:\Program Files\datakit\cache\profile_inputs by default on Windows
# cache_capacity_mb = 10240 # 10240MB
# clear_cache_on_start = false
# upload_workers = 8
# send_timeout = "75s"
# send_retry_count = 4
## set custom tags for profiling data
# [inputs.profile.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
## go pprof config
## collect profiling data in pull mode
#[[inputs.profile.go]]
## pprof url
#url = "http://localhost:6060"
## pull interval, should be greater or equal than 10s
#interval = "10s"
## service name
#service = "go-demo"
## app env
#env = "dev"
## app version
#version = "0.0.0"
## types to pull
## values: cpu, goroutine, heap, mutex, block
#enabled_types = ["cpu","goroutine","heap","mutex","block"]
#[inputs.profile.go.tags]
# tag1 = "val1"
## pyroscope config
#[[inputs.profile.pyroscope]]
## listen url
#url = "0.0.0.0:4040"
## service name
#service = "pyroscope-demo"
## app env
#env = "dev"
## app version
#version = "0.0.0"
#[inputs.profile.pyroscope.tags]
#tag1 = "val1"
Once configured, restart DataKit.
The collector can now be turned on by ConfigMap Injection Collector Configuration.