Docker
StackState Self-hosted v5.1.x
Overview
StackState Agent V3
StackState Agent V3 can run in a Docker container. The Agent collects data from the host where it's running and can be configured to integrate with external systems. Retrieved data is pushed to StackState, to work with this data the StackState Agent V2 StackPack must be installed in your StackState instance. For details of the data retrieved and available integrations, see the StackPack integration documentation.
In Docker Swarm mode, the StackState Swarm Agent can be deployed on the manager node to retrieve topology data for the cluster.
Monitoring
StackState Agent V3 will retrieve topology and metrics data from the host that it's running on. In Docker swarm mode, StackState Cluster Agent running on the manager node will synchronize data for a Docker cluster. For details, see the data retrieved.
Setup
Single container
To start a single Docker container with StackState Agent V3, run the command below.
<STACKSTATE_RECEIVER_API_KEY>
is set during StackState installation.<STACKSTATE_RECEIVER_API_ADDRESS>
is specific to your installation of StackState.
For details see StackState Receiver API.
Docker compose
To run StackState Agent V3 with Docker compose:
Add the following configuration to the compose file on each node where the Agent will run.
<STACKSTATE_RECEIVER_API_KEY>
is set during StackState installation.<STACKSTATE_RECEIVER_API_ADDRESS>
is specific to your installation of StackState. For details see StackState Receiver API.
Run the command:
Docker swarm mode
In Docker Swarm mode, the StackState Cluster Agent can be deployed on the manager node to retrieve basic topology data (services, containers and the relations between them). To retrieve full data, StackState Agent V3 must also be deployed on each node as a Docker compose setup.
To run StackState Swarm Agent in Docker Swarm mode:
Create a file
docker-compose.yml
with the following content. Update to include details of your StackState instance:<STACKSTATE_RECEIVER_API_KEY>
is set during StackState installation.<STACKSTATE_RECEIVER_API_ADDRESS>
is specific to your installation of StackState. For details see StackState Receiver API.<CLUSTER_NAME>
is the name you would like to give this cluster
Run the command:
Running the StackState Swarm Agent in Docker Swarm mode will collect basic topology data from the cluster. To retrieve more data, including telemetry, StackState Agent V3 must also be installed on each node in the Swarm cluster as a Docker compose setup.
Upgrade
To upgrade StackState Agent V3 running inside a Docker container.
Stop the running container and remove it.
Run the container using the instructions provided in setup.
Configure
Agent configuration
The StackState Agent V3 configuration is located in the file /etc/stackstate-agent/stackstate.yaml
. The configuration file contains the STS_API_KEY
and STS_STS_URL
environment variables set when the Docker command is run. No further configuration should be required, however, a number of advanced configuration options are available.
Advanced Agent configuration
StackState Agent V3 can be configured to reduce data production, tune the process blacklist, or turn off specific features when not needed. The required settings are described in detail on the page advanced Agent configuration.
External integration configuration
StackState Agent V3 can be configured to run checks that integrate with external systems. Each integration has its own configuration file that's used by the associated Agent check. Configuration files for integrations that will run through StackState Agent V3 in Docker should be added as a volume to the directory /etc/stackstate-agent/conf.d/
when the container is started.
For example, the Agent Docker configuration below includes a volume with a check configuration file for the ServiceNow integration:
Documentation for the available StackState integrations, including how to configure the associated Agent checks, can be found on the StackPacks > Integrations pages.
Proxy configuration
The Agent can be configured to use a proxy for HTTP and HTTPS requests. For details, see use an HTTP/HTTPS proxy.
Self-Signed Certificates
If StackState Agent V3 will run checks that are configured to use self-signed certificates for HTTPs requests, override the CURL_CA_BUNDLE
environment variable:
Traces
StackState Agent V3 can be configured to collect traces via a StackState tracing integration. If the Agent will be used in conjunction with a language specific trace client, make sure to configure your app to use the host’s PID namespace:
Commands
Start or stop the Agent
To start, stop or restart StackState Agent V3, start or stop the container it's running in:
Status and information
For status information, refer to the Docker log files for the container.
To run the Agent status command inside a container:
Manually run a check
Use the command below to manually run an Agent check.
Troubleshooting
To troubleshoot the Agent, try to check the Agent status or manually run a check.
Log files
Docker logs for the StackState Agent V3 container can be followed using the command:
Inside the running container, StackState Agent V3 logs are in the following files:
/var/log/stackstate-agent/agent.log
/var/log/stackstate-agent/process-agent.log
Debug mode
By default, the log level of the Agent container is set to INFO
. To assist in troubleshooting, the Agent log level can be set to DEBUG
. This will enable verbose logging and all errors encountered will be reported in the Agent log files.
To set the log level to DEBUG
for an Agent running on Docker, use the STS_LOG_LEVEL
environment variable. Other optional logging settings:
STS_LOG_PAYLOADS: "true"
- include the topology/telemetry payloads sent to StackState in the Agent log.STS_LOG_TO_CONSOLE: "true"
- write log output to the container stdout.
For example:
Support knowledge base
Troubleshooting steps for any known issues can be found in the StackState support knowledge base.
Uninstall
To uninstall StackState Agent V3, stop the Docker container it's running in and remove it.
Data retrieved
Topology
StackState Agent V3 will retrieve the following topology data from the host that it's running on:
Hosts, processes and containers
Network connections between processes/containers/services
In Docker swarm mode, StackState Cluster Agent running on the manager node will synchronize the following topology data for a Docker cluster:
Containers
Services
Relations between containers and services
Metrics
StackState Agent V3 will retrieve the metrics listed below for containers. Telemetry for hosts and processes, as well as network traffic telemetry for network connections between processes/containers/services will also be retrieved.
Metrics for containers
The list below shows the container metrics that are provided by default. Additional metrics may be supplied by other sources based on your specific implementation.
Container Restart
Container State
CPU amount of seconds throttled
CPU number of times throttled
CPU threads count
CPU time - System (percentage / second)
CPU time - Total (percentage / second)
CPU time - User (percentage / second)
IO read (bytes / second)
IO written (bytes / second)
Memory - Cache (bytes)
Memory - Resident (bytes)
Network received (bytes / second)
Network received (packets / second)
Network sent (bytes / second)
Network sent (packets / second)
See also
Last updated