Deploying on Kubernetes¶
Install DataKit Agent¶
Before performing system and application link data analysis, you need to deploy the Guance DataKit collector on each target host to collect the necessary link data.
Enable DDTrace Collector¶
DDTrace is used to receive, process, and analyze Tracing protocol data. Execute the following command to enable the DDTrace collector. For other third-party Tracing collector configurations, please refer to Integrations.
- name: ENV_DEFAULT_ENABLED_INPUTS
value: cpu,disk,diskio,mem,swap,system,hostobject,net,host_processes,container,ddtrace
After configuration, restart DataKit:
Choose Language¶
Java¶
Install dependencies:
Run the application:
In Kubernetes, you can inject the trace agent through Datakit Operator, or manually mount the trace agent to the application container:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: <CONTAINER_NAME>
image: <CONTAINER_IMAGE>/<TAG>
env:
Parameter configuration:
service.name
: Service name;env
: Environment information of the application service;version
: Version number;- Customize DataKit listening address, if not set, follow the default address;
- Set sampling rate: After enabling, it can reduce the actual amount of data generated; the number range is from 0.0(0%) ~ 1.0(100%);
- Collect Profiling data: After enabling, you can see more information about the application runtime;
- Enable JVM metric collection: Requires enabling the statsd collector simultaneously.
For more parameter configurations, refer to here.
Python¶
Install dependencies:
Run the application:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: <CONTAINER_NAME>
image: <CONTAINER_IMAGE>/<TAG>
env:
- name: DD_AGENT_HOST
value: "datakit-service.datakit.svc"
- name: DD_TRACE_AGENT_PORT
value: 9529
Parameter configuration:
service.name
: Service name;env
: Environment information of the application service;version
: Version number;- Customize DataKit listening address, if not set, follow the default address;
- Set sampling rate for the service: After enabling, it can reduce the actual amount of data generated; the number range is from 0.0(0%) ~ 1.0(100%);
- Collect Profiling data: After enabling, you can see more information about the application runtime;
- Enable Python metric collection: Requires enabling the statsd collector simultaneously.
For more parameter configurations, refer to here.
Golang¶
Install dependencies:
Run the application:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: <CONTAINER_NAME>
image: <CONTAINER_IMAGE>/<TAG>
env:
- name: DD_AGENT_HOST
value: "datakit-service.datakit.svc"
- name: DD_TRACE_AGENT_PORT
value: 9529
Parameter configuration:
service.name
: Service name;env
: Environment information of the application service;version
: Version number;- Customize DataKit listening address, if not set, follow the default address;
- Set sampling rate: After enabling, it can reduce the actual amount of data generated; the number range is from 0.0(0%) ~ 1.0(100%).
For more parameter configurations, refer to here.
Node.JS¶
Run the application:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: <CONTAINER_NAME>
image: <CONTAINER_IMAGE>/<TAG>
env:
- name: DD_AGENT_HOST
value: "datakit-service.datakit.svc"
- name: DD_TRACE_AGENT_PORT
value: 9529
Parameter configuration:
service.name
: Service name;env
: Environment information of the application service;version
: Version number;- Customize DataKit listening address, if not set, follow the default address;
- Set sampling rate: After enabling, it can reduce the actual amount of data generated; the number range is from 0.0(0%) ~ 1.0(100%).
C++¶
PHP¶
Run the application:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: <CONTAINER_NAME>
image: <CONTAINER_IMAGE>/<TAG>
env:
- name: DD_AGENT_HOST
value: "datakit-service.datakit.svc"
- name: DD_TRACE_AGENT_PORT
value: 9529
Parameter configuration:
service.name
: Service name;env
: Environment information of the application service;version
: Version number;- Customize DataKit listening address, if not set, follow the default address;
- Set sampling rate for the service: After enabling, it can reduce the actual amount of data generated; the number range is from 0.0(0%) ~ 1.0(100%);
- Collect Profiling data: After enabling, you can see more information about the application runtime.