Advanced Agent configuration
StackState Self-hosted v5.0.x

Overview

A number of advanced configuration options are available for StackState Agent V2. These can be set either in the stackstate.yaml configuration file (Linux and Windows) or using environment variables (Docker, Kubernetes and OpenShift).

Reduce data production

The StackState Agent collection interval can be configured. This will reduce the amount of data produced by the Agent.
Kubernetes, OpenShift
Docker
Linux
Windows
To configure the collection interval of the Kubernetes and system level integrations, create a values.yaml file with the below contents and specify this when you install/upgrade the StackState Agent. In this values.yaml example, the min_collection_interval has been set to double the default setting. This should result in a noticeable drop in the amount of data produced. If required, you can increase the interval further, however, the aim should be to find a balance between the frequency of data collection and the amount of data received by StackState:
Note that the values.yaml example below includes configuration to enable clusterChecks and run the Kubernetes_state check as a cluster check.
1
clusterChecks:
2
# clusterChecks.enabled -- Enables the cluster checks functionality _and_ the clustercheck pods.
3
enabled: true
4
agent:
5
config:
6
override:
7
- name: conf.yaml
8
path: /etc/stackstate-agent/conf.d/kubelet.d
9
data: |
10
init_config:
11
instances:
12
- min_collection_interval: 60
13
- name: conf.yaml
14
path: /etc/stackstate-agent/conf.d/memory.d
15
data: |
16
init_config:
17
instances:
18
- min_collection_interval: 30
19
- name: conf.yaml
20
path: /etc/stackstate-agent/conf.d/cpu.d
21
data: |
22
init_config:
23
instances:
24
- min_collection_interval: 30
25
- name: conf.yaml
26
path: /etc/stackstate-agent/conf.d/disk.d
27
data: |
28
init_config:
29
instances:
30
- min_collection_interval: 30
31
use_mount: false
32
excluded_filesystems:
33
- tmpfs
34
- squashfs
35
- name: conf.yaml
36
path: /etc/stackstate-agent/conf.d/io.d
37
data: |
38
init_config:
39
instances:
40
- min_collection_interval: 30
41
- name: conf.yaml
42
path: /etc/stackstate-agent/conf.d/load.d
43
data: |
44
init_config:
45
instances:
46
- min_collection_interval: 30
47
- name: conf.yaml
48
path: /etc/stackstate-agent/conf.d/docker.d
49
data: |
50
init_config:
51
instances:
52
- min_collection_interval: 30
53
- name: conf.yaml
54
path: /etc/stackstate-agent/conf.d/file_handle.d
55
data: |
56
init_config:
57
instances:
58
- min_collection_interval: 30
59
- name: auto_conf.yaml
60
path: /etc/stackstate-agent/conf.d/kubernetes_state.d
61
data: |
62
- name: stackstate.yaml
63
path: /etc/stackstate-agent
64
data: |
65
## Provides autodetected defaults, for kubernetes environments,
66
## please see stackstate.yaml.example for all supported options
67
​
68
# Autodiscovery for Kubernetes
69
listeners:
70
- name: kubelet
71
config_providers:
72
- name: kubelet
73
polling: true
74
75
process_config:
76
intervals:
77
container: 40
78
process: 30
79
connections: 30
80
​
81
apm_config:
82
apm_non_local_traffic: true
83
max_memory: 0
84
max_cpu_percent: 0
85
​
86
# Use java container support
87
​
88
clusterAgent:
89
config:
90
override:
91
- name: conf.yaml
92
path: /etc/stackstate-agent/conf.d/kubernetes_state.d
93
data: |
94
cluster_check: true
95
init_config:
96
instances:
97
- kube_state_url: http://YOUR_KUBE_STATE_METRICS_SERVICE_NAME:8080/metrics
98
min_collection_interval: 60
Copied!
Specify the values.yaml file during installation / upgrade of the StackState Agent with the --values argument:
1
helm upgrade --install \
2
--namespace stackstate \
3
--create-namespace \
4
--set-string 'stackstate.apiKey=<STACKSTATE_RECEIVER_API_KEY>' \
5
... (set all custom fields)
6
--values values.yaml
7
stackstate-cluster-agent stackstate/cluster-agent
Copied!
To reduce data production in StackState Agent running in a Docker container:
  1. 1.
    Configure the min_collection_interval for each of the following system integrations. The default setting is 15 seconds. Doubling this value should result in a noticeable drop in the amount of data produced. If required, you can increase the interval further, however, the aim should be to find a balance between the frequency of data collection and the amount of data received by StackState:
    • Memory - /etc/stackstate-agent/conf.d/memory.d/conf.yaml
    • CPU - /etc/stackstate-agent/conf.d/cpu.d/conf.yaml
    • Disk - /etc/stackstate-agent/conf.d/disk.d/conf.yaml
    • Load - /etc/stackstate-agent/conf.d/load.d/conf.yaml
    • File handle - /etc/stackstate-agent/conf.d/file_handle.d/conf.yaml
  2. 2.
    Set the intervals for process, container and connection gathering in /etc/stackstate-agent/stackstate.yaml:
    1
    process_config:
    2
    intervals:
    3
    container: 40
    4
    process: 30
    5
    connections: 30
    Copied!
  3. 3.
    Mount the config files as a volume into the container running the Agent as described in Docker Agent integration configuration.
To reduce data production in StackState Agent running on Linux:
  1. 1.
    Configure the min_collection_interval for each of the following system integrations. The default setting is 15 seconds. Doubling this value should result in a noticeable drop in the amount of data produced. If required, you can increase the interval further, however, the aim should be to find a balance between the frequency of data collection and the amount of data received by StackState:
    • Memory - /etc/stackstate-agent/conf.d/memory.d/conf.yaml
    • CPU - /etc/stackstate-agent/conf.d/cpu.d/conf.yaml
    • Disk - /etc/stackstate-agent/conf.d/disk.d/conf.yaml
    • Load - /etc/stackstate-agent/conf.d/load.d/conf.yaml
    • File handle - /etc/stackstate-agent/conf.d/file_handle.d/conf.yaml
  2. 2.
    Set the intervals for process, container and connection gathering in /etc/stackstate-agent/stackstate.yaml:
    1
    process_config:
    2
    intervals:
    3
    container: 40
    4
    process: 30
    5
    connections: 30
    Copied!
To reduce data production in StackState Agent running on Windows:
  1. 1.
    Configure the min_collection_interval for each of the following system integrations. The default setting is 15 seconds. Doubling this value should result in a noticeable drop in the amount of data produced. If required, you can increase the interval further, however, the aim should be to find a balance between the frequency of data collection and the amount of data received by StackState:
    • Memory - C:\ProgramData\StackState\conf.d\memory.d\conf.yaml
    • CPU - C:\ProgramData\StackState\conf.d\cpu.d\conf.yaml
    • Disk - C:\ProgramData\StackState\conf.d\disk.d\conf.yaml
    • Load - C:\ProgramData\StackState\conf.d\load.d\conf.yaml
    • File handle - C:\ProgramData\StackState\conf.d\file_handle.d\conf.yaml
  2. 2.
    Set the intervals for process, container and connection gathering in C:\ProgramData\StackState\stackstate.yaml:
    1
    process_config:
    2
    intervals:
    3
    container: 40
    4
    process: 30
    5
    connections: 30
    Copied!

Use a proxy for HTTP/HTTPS

The Agent can be configured to use a proxy for HTTP and HTTPS requests. For details, see use an HTTP/HTTPS proxy.

Blacklist and inclusions

Processes reported by StackState Agent V2 can optionally be filtered using a blacklist. Using this in conjunction with inclusion rules will allow otherwise excluded processes to be included.
The blacklist is specified as a list of regex patterns. Inclusions override the blacklist patterns, these are used to include processes that consume a lot of resources. Each inclusion type specifies an amount of processes to report as the top resource using processes. For top_cpu and top_mem a threshold must first be met, meaning that a process needs to consume a higher percentage of resources than the specified threshold before it is reported.
Docker, Kubernetes, OpenShift
Linux, Windows
To specify a blacklist and/or inclusions, set the associated environment variables and restart StackState Agent V2.
Environment variable
Description
STS_PROCESS_BLACKLIST_PATTERNS
A list of regex patterns that will exclude a process if matched. Default patterns (github.com).
STS_PROCESS_BLACKLIST_INCLUSIONS_CPU_THRESHOLD
Threshold that enables the reporting of high CPU usage processes.
STS_PROCESS_BLACKLIST_INCLUSIONS_TOP_CPU
The number of processes to report that have a high CPU usage. Default 0.
STS_PROCESS_BLACKLIST_INCLUSIONS_TOP_IO_READ
The number of processes to report that have a high IO read usage. Default 0.
STS_PROCESS_BLACKLIST_INCLUSIONS_TOP_IO_WRITE
The number of processes to report that have a high IO write usage. Default 0.
STS_PROCESS_BLACKLIST_INCLUSIONS_MEM_THRESHOLD
Threshold that enables the reporting of high memory usage processes.
STS_PROCESS_BLACKLIST_INCLUSIONS_TOP_MEM
The number of processes to report that have a high memory usage. Default 0.
To specify a blacklist and/or inclusions, edit the below settings in the Agent configuration file stackstate.yaml and restart StackState Agent V2.
  • Linux - /etc/stackstate-agent/stackstate.yaml
  • Windows - C:\ProgramData\StackState\stackstate.yaml
Configuration item
Description
process_blacklist.patterns
A list of regex patterns that will exclude a process if matched. Default patterns (github.com).
process_blacklist.inclusions.cpu_pct_usage_threshold
Threshold that enables the reporting of high CPU usage processes.
process_blacklist.inclusions.amount_top_cpu_pct_usage
The number of processes to report that have a high CPU usage. Default 0.
process_blacklist.inclusions.amount_top_io_read_usage
The number of processes to report that have a high IO read usage. Default 0.
process_blacklist.inclusions.amount_top_io_write_usage
The number of processes to report that have a high IO write usage. Default 0.
process_blacklist.inclusions.mem_usage_threshold
Threshold that enables the reporting of high memory usage processes.
process_blacklist.inclusions.amount_top_mem_usage
The number of processes to report that have a high memory usage. Default 0.

Enable traces

The trace Agent will be enabled by default when StackState Agent is installed. It is required to receive traces in StackState. In case it has been disabled, you can enable it again using the instructions below.
Docker
Linux
Windows
To enable tracing on StackState Agent running on Docker, edd the following parameters to your docker run command:
  • -e STS_APM_URL="https://stackstate-ip:receiver-port/stsAgent"
    • The default StackState Receiver port is 7077.
  • -e STS_APM_ENABLED="true"
    • Allows the StackState Trace Agent to capture traces.
To enable tracing on StackState Agent running on Linux, edit the configuration file /etc/stackstate-agent/stackstate.yamland set the following variables:
  • apm_sts_url="https://stackstate-ip:receiver-port/stsAgent"
    • The default StackState Receiver port is 7077.
  • enabled="true"
    • Can be found under apm_config.enabled.
    • Allows the StackState Trace Agent to capture traces.
To enable tracing on StackState Agent running on Windows, edit the configuration file C:\ProgramData\StackState\stackstate.yaml and change the following variables:
  • apm_sts_url="https://stackstate-ip:receiver-port/stsAgent"
    • The default StackState Receiver port is 7077.
  • enabled="true"
    • Can be found under apm_config.enabled.
    • Allows the StackState Trace Agent to capture traces.

Disable Agent features

Certain features of the Agent can optionally be turned off if they are not needed.
Docker, Kubernetes, OpenShift
Linux, Windows
To disable a feature, set the associated environment variable and restart StackState Agent V2.
Environment variable
Description
STS_PROCESS_AGENT_ENABLED
Default true (collects containers and processes). Set to false to collect only containers, or disabled to disable the process Agent.
STS_APM_ENABLED
Default true. Set to "false" to disable the APM Agent.
STS_NETWORK_TRACING_ENABLED
Default true. Set to false to disable the network tracer.
To disable a feature, edit the below settings in the Agent configuration file stackstate.yaml and restart StackState Agent V2.
  • Linux - /etc/stackstate-agent/stackstate.yaml
  • Windows - C:\ProgramData\StackState\stackstate.yaml
Configuration item
Description
process_config.enabled
Default true (collects containers and processes). Set to false to collect only containers, or disabled to disable the process Agent.
apm_config.enabled
Default true. Set to "false" to disable the APM Agent.
network_tracer_config.network_tracing_enabled
Default true. Set to false to disable the network tracer.