LogoLogo
StackState.comDownloadSupportExplore playground
StackState v5.1
StackState v5.1
  • Welcome to the StackState docs!
  • StackState self-hosted v5.1 docs
  • Getting Started
  • πŸš€Setup
    • Install StackState
      • Requirements
      • Kubernetes / OpenShift
        • Kubernetes install
        • OpenShift install
        • Required Permissions
        • Non-high availability setup
        • Override default configuration
        • Configure storage
        • Configure Ingress
        • Install from custom image registry
        • Migrate from Linux install
      • Linux
        • Before you install
        • Download
        • Install StackState
        • Install with production configuration
        • Install with development configuration
        • Install with POC configuration
        • Set up a reverse proxy
        • Set up TLS without reverse proxy
      • Initial run guide
      • Troubleshooting
    • Upgrade StackState
      • Steps to upgrade
      • Version specific upgrade instructions
      • StackPack versions
      • StackState release notes
    • StackState Agent
      • About StackState Agent V3
      • Docker
      • Kubernetes / OpenShift
      • Linux
      • Windows
      • Advanced Agent configuration
      • Use an HTTP/HTTPS proxy
      • Agent V1 (legacy)
      • Migrate Agent V1 to Agent V2
        • Linux
        • Docker
    • StackState CLI
      • CLI: sts
      • CLI: stac (deprecated)
      • Comparison between CLIs
    • Data management
      • Backup and Restore
        • Kubernetes backup
        • Linux backup
        • Configuration backup
      • Data retention
      • Clear stored data
  • πŸ‘€Use
    • Concepts
      • The 4T data model
      • Components
      • Relations
      • Health state
      • Layers, Domains and Environments
      • Perspectives
      • Anomaly detection
      • StackState architecture
    • StackState UI
      • Explore mode
      • Filters
      • Views
        • About views
        • Configure the view health
        • Create and edit views
        • Visualization settings
      • Perspectives
        • Topology Perspective
        • Events Perspective
        • Traces Perspective
        • Metrics Perspective
      • Timeline and time travel
      • Analytics
      • Keyboard shortcuts
    • Checks and monitors
      • Checks
      • Add a health check
      • Anomaly health checks
      • Monitors
      • Manage monitors
    • Problem analysis
      • About problems
      • Problem lifecycle
      • Investigate a problem
      • Problem notifications
    • Metrics
      • Telemetry streams
      • Golden signals
      • Top metrics
      • Add a telemetry stream
      • Browse telemetry
      • Set telemetry stream priority
    • Events
      • About events
      • Event notifications
      • Manage event handlers
    • Glossary
  • 🧩StackPacks
    • About StackPacks
    • Add-ons
      • Autonomous Anomaly Detector
      • Health Forecast
    • Integrations
      • About integrations
      • πŸ’ StackState Agent V2
      • πŸ’ AWS
        • AWS
        • AWS ECS
        • AWS X-ray
        • StackState/Agent IAM role: EC2
        • StackState/Agent IAM role: EKS
        • Policies for AWS
        • AWS (legacy)
        • Migrate AWS (legacy) to AWS
      • πŸ’ Dynatrace
      • πŸ’ Kubernetes
      • πŸ’ OpenShift
      • πŸ’ OpenTelemetry
        • About instrumentations
        • AWS NodeJS Instrumentation
        • Manual Instrumentation
          • Prerequisites
          • Tracer and span mappings
          • Relations between components
          • Span health state
          • Merging components
          • Code examples
      • πŸ’ ServiceNow
      • πŸ’ Slack
      • πŸ’ Splunk
        • Splunk
        • Splunk Events
        • Splunk Health
        • Splunk Metrics
        • Splunk Topology
      • πŸ’ VMWare vSphere
      • Apache Tomcat
      • Azure
      • Cloudera
      • Custom Synchronization
      • DotNet APM
      • Elasticsearch
      • Humio
      • Java APM
      • JMX
      • Logz.io
      • MySQL
      • Nagios
      • OpenMetrics
      • PostgreSQL
      • Prometheus
      • SAP
      • SCOM
      • SolarWinds
      • Static Health
      • Static Topology
      • Traefik
      • WMI
      • Zabbix
    • Develop your own StackPacks
  • πŸ”§Configure
    • Topology
      • Component actions
      • Identifiers
      • Topology naming guide
      • Topology sources
      • Create a topology manually
      • Configure topology synchronizations
      • Enable email event notifications
      • Send topology data over HTTP
      • Set the topology filtering limit
      • Use a proxy for event handlers
      • Use tags
      • Tune topology synchronization
      • Debug topology synchronization
    • Telemetry
      • Add telemetry during topology synchronization
      • Data sources
        • Elasticsearch
        • Prometheus mirror
      • Send events over HTTP
      • Send metrics data over HTTP
      • Set the default telemetry interval
      • Debug telemetry synchronization
    • Traces
      • Set up traces
      • Advanced configuration for traces
    • Health
      • Health synchronization
      • Send health data over HTTP
        • Send health data
        • Repeat Snapshots JSON
        • Repeat States JSON
        • Transactional Increments JSON
      • Debug health synchronization
    • Anomaly Detection
      • Export anomaly feedback
      • Scale the AAD up and down
      • The AAD status UI
    • Security
      • Authentication
        • Authentication options
        • File based
        • LDAP
        • Open ID Connect (OIDC)
        • KeyCloak
        • Service tokens
      • RBAC
        • Role-based Access Control
        • Permissions
        • Roles
        • Scopes
        • Subjects
      • Secrets management
      • Self-signed certificates
      • Set up a security backend for Linux
      • Set up a security backend for Windows
    • Logging
      • Kubernetes logs
      • Linux logs
      • Enable logging for functions
  • πŸ“–Develop
    • Developer guides
      • Agent checks
        • About Agent checks
        • Agent check API
        • Agent check state
        • How to develop Agent checks
        • Connect an Agent check to StackState
      • Custom functions and scripts
        • StackState functions
        • Check functions
        • Component actions
        • Event handler functions
        • ID extractor functions
        • Mapping functions
        • Monitor functions
        • Propagation functions
        • Template functions
        • View health state configuration functions
      • Custom Synchronization StackPack
        • About the Custom Synchronization StackPack
        • How to customize elements created by the Custom Synchronization StackPack
        • How to configure a custom synchronization
      • Integrate external services
      • Mirroring Telemetry
      • Monitors
        • Create monitors
        • Monitor STJ file format
      • StackPack development
        • How to create a StackPack
        • Packaging
        • How to get a template file
        • How to make a multi-instance StackPack
        • Prepare a multi-instance provisioning script
        • Upload a StackPack file
        • Prepare a shared template
        • Customize a StackPack
        • Prepare instance template files
        • Prepare a StackPack provisioning script
        • Resources in a StackPack
        • StackState Common Layer
      • Synchronizations and templated files
    • Reference
      • StackState OpenAPI docs
      • StackState Template JSON (STJ)
        • Using STJ
        • Template functions
      • StackState Markup Language (STML)
        • Using STML
        • STML Tags
      • StackState Query Language (STQL)
      • StackState Scripting Language (STSL)
        • Scripting in StackState
        • Script result: Async
        • Script result: Streaming
        • Time in scripts
        • Script APIs
          • Async - script API
          • Component - script API
          • HTTP - script API
          • Prediction - script API
          • StackPack - script API
          • Telemetry - script API
          • Time - script API
          • Topology - script API
          • UI - script API
          • View - script API
    • Tutorials
      • Create a simple StackPack
      • Push data to StackState from an external system
      • Send events to StackState from an external system
      • Set up a mirror to pull telemetry data from an external system
Powered by GitBook
LogoLogo

Legal notices

  • Privacy
  • Cookies
  • Responsible disclosure
  • SOC 2/SOC 3
On this page
  • Overview
  • Monitoring
  • Setup
  • Single container
  • Docker compose
  • Docker swarm mode
  • Upgrade
  • Configure
  • Agent configuration
  • Advanced Agent configuration
  • External integration configuration
  • Proxy configuration
  • Self-Signed Certificates
  • Traces
  • Commands
  • Start or stop the Agent
  • Status and information
  • Manually run a check
  • Troubleshooting
  • Log files
  • Debug mode
  • Support knowledge base
  • Uninstall
  • Data retrieved
  • Topology
  • Metrics
  • See also
  1. Setup
  2. StackState Agent

Docker

StackState Self-hosted v5.1.x

PreviousAbout StackState Agent V3NextKubernetes / OpenShift

Last updated 1 year ago

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 must be installed in your StackState instance. For details of the data retrieved and available integrations, see the .

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 , StackState Cluster Agent running on the manager node will synchronize data for a Docker cluster. For details, see the .

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 .

docker run -d \
    --name stackstate-agent \
    --privileged \
    --network="host" \
    --pid="host" \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    -v /proc/:/host/proc/:ro \
    -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
    -v /etc/passwd:/etc/passwd:ro \
    -v /sys/kernel/debug:/sys/kernel/debug \
    -e STS_API_KEY="<STACKSTATE_RECEIVER_API_KEY>" \
    -e STS_STS_URL="<STACKSTATE_RECEIVER_API_ADDRESS>" \
    -e STS_PROCESS_AGENT_URL="<STACKSTATE_RECEIVER_API_ADDRESS>" \
    -e STS_PROCESS_AGENT_ENABLED="true" \
    -e STS_NETWORK_TRACING_ENABLED="true" \
    -e STS_PROTOCOL_INSPECTION_ENABLED="true" \
    -e STS_APM_URL="<STACKSTATE_RECEIVER_API_ADDRESS>" \
    -e STS_APM_ENABLED="true" \
    -e HOST_PROC="/host/proc" \
    -e HOST_SYS="/host/sys" \
    quay.io/stackstate/stackstate-agent:3.0.0

Docker compose

To run StackState Agent V3 with Docker compose:

  1. 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-agent:
 image: quay.io/stackstate/stackstate-agent:3.0.0
 network_mode: "host"
 pid: "host"
 privileged: true
 volumes:
   - "/var/run/docker.sock:/var/run/docker.sock:ro"
   - "/proc/:/host/proc/:ro"
   - "/sys/fs/cgroup/:/host/sys/fs/cgroup:ro"
   - "/etc/passwd:/etc/passwd:ro"
   - "/sys/kernel/debug:/sys/kernel/debug"
 environment:
   STS_API_KEY: "<STACKSTATE_RECEIVER_API_KEY>"
   STS_STS_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
   STS_PROCESS_AGENT_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
   STS_PROCESS_AGENT_ENABLED: "true"
   STS_NETWORK_TRACING_ENABLED: "true"
   STS_PROTOCOL_INSPECTION_ENABLED: "true"
   STS_APM_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
   STS_APM_ENABLED: "true"
   HOST_PROC: "/host/proc"
   HOST_SYS: "/host/sys"
  1. Run the command:

    docker-compose up -d

Docker swarm mode

To run StackState Swarm Agent in Docker Swarm mode:

  1. 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.

    • <CLUSTER_NAME> is the name you would like to give this cluster

stackstate-agent:
    image: quay.io/stackstate/stackstate-swarm-agent:2.19.1
    deploy:
      placement:
        constraints: [ node.role == manager ]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/passwd:/etc/passwd:ro
      - /sys/kernel/debug:/sys/kernel/debug
    environment:
      STS_API_KEY: "<STACKSTATE_RECEIVER_API_KEY>"
      STS_STS_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
      STS_COLLECT_SWARM_TOPOLOGY: "true"
      STS_LOG_LEVEL: "debug"
      STS_LOG_TO_CONSOLE: "true"
      DOCKER_SWARM: "true"
      STS_CLUSTER_NAME: <CLUSTER_NAME>
  1. Run the command:

    docker stack deploy -c docker-compose.yml

Upgrade

To upgrade StackState Agent V3 running inside a Docker container.

  1. Stop the running container and remove it.

docker stop stackstate-agent
docker container rm stackstate-agent

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

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:

stackstate-agent:
    image: quay.io/stackstate/stackstate-agent:3.0.0
    network_mode: "host"
    pid: "host"
    privileged: true
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/proc/:/host/proc/:ro"
      - "/sys/fs/cgroup/:/host/sys/fs/cgroup:ro"
      - "/etc/passwd:/etc/passwd:ro"
      - "/sys/kernel/debug:/sys/kernel/debug"
      - "/etc/stackstate-agent/conf.d/servicenow.d/conf.yaml:/servicenow.d/conf.yaml:ro"
    environment:
      STS_API_KEY: "<STACKSTATE_RECEIVER_API_KEY>"
      STS_STS_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
      HOST_PROC: "/host/proc"
      HOST_SYS: "/host/sys"

Proxy configuration

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:

  CURL_CA_BUNDLE = ""

Traces

  service:
    ...
    pid: "host" # should match with processes reported by the StackState process Agent
    ...

Commands

Start or stop the Agent

To start, stop or restart StackState Agent V3, start or stop the container it's running in:

# Start container
docker start stackstate-agent

# Stop container
docker stop stackstate-agent

Status and information

For status information, refer to the Docker log files for the container.

To run the Agent status command inside a container:

docker exec stackstate-agent bash -c 'agent status'

Manually run a check

Use the command below to manually run an Agent check.

# Execute a check once and display the results.
docker exec stackstate-agent bash -c 'agent check <CHECK_NAME>'

# Execute a check once with log level debug and display the results.
docker exec stackstate-agent bash -c 'agent check -l debug <CHECK_NAME>'

Troubleshooting

Log files

Docker logs for the StackState Agent V3 container can be followed using the command:

docker logs -f stackstate-agent

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:

stackstate-agent:
  image: quay.io/stackstate/stackstate-agent:3.0.0
  network_mode: "host"
  pid: "host"
  privileged: true
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock:ro"
    - "/proc/:/host/proc/:ro"
    - "/sys/fs/cgroup/:/host/sys/fs/cgroup:ro"
    - "/etc/passwd:/etc/passwd:ro"
    - "/sys/kernel/debug:/sys/kernel/debug"
  environment:
    STS_API_KEY: "<STACKSTATE_RECEIVER_API_KEY>"
    STS_STS_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
    STS_PROCESS_AGENT_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
    STS_PROCESS_AGENT_ENABLED: "true"
    STS_NETWORK_TRACING_ENABLED: "true"
    STS_PROTOCOL_INSPECTION_ENABLED: "true"
    STS_APM_URL: "<STACKSTATE_RECEIVER_API_ADDRESS>"
    STS_APM_ENABLED: "true"
    HOST_PROC: "/host/proc"
    HOST_SYS: "/host/sys"
    STS_LOG_LEVEL: "debug"
    STS_LOG_TO_CONSOLE: "true"
    STS_LOG_PAYLOADS: "true"

Support knowledge base

Uninstall

To uninstall StackState Agent V3, stop the Docker container it's running in and remove it.

docker stop stackstate-agent
docker container rm stackstate-agent

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

  • 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

<STACKSTATE_RECEIVER_API_ADDRESS> is specific to your installation of StackState. For details see .

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 .

<STACKSTATE_RECEIVER_API_ADDRESS> is specific to your installation of StackState. For details see .

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 .

Run the container using the instructions provided in .

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 .

Documentation for the available StackState integrations, including how to configure the associated Agent checks, can be found on the .

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

StackState Agent V3 can be configured to collect traces via a . 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:

To troubleshoot the Agent, try to or .

Troubleshooting steps for any known issues can be found in the .

In , StackState Cluster Agent running on the manager node will synchronize the following topology data for a Docker cluster:

πŸš€
advanced Agent configuration
StackPacks > Integrations pages
use an HTTP/HTTPS proxy
StackState support knowledge base
About StackState Agent V3
StackState Agent V2 StackPack
StackPack integration documentation
StackState Agent V3 (github.com)
Docker compose setup
Docker compose setup
setup
check the Agent status
manually run a check
Docker swarm mode
StackState Agent V2 StackPack
StackPack integration documentation
Docker swarm mode
data retrieved
StackState tracing integration
StackState Receiver API
StackState Receiver API
StackState Receiver API