Configuration
SolarWinds Snap Agent's main configuration file is C:\ProgramData\SolarWinds\Snap\config.yaml
. The configuration file uses the YAML
file format; it is read on agent startup.
Updates to the configuration file only take effect after restarting the agent.
Path separaters within the YAML configuration file need to be the forward slash /
.
- Publishing to AppOptics
- Publishing through a proxy
- Detecting if running on EC2 (OpenStack) instance
- Publishing to a File
- Autoloading plugins and tasks
- Log level
- Global Tags
- Optional Metrics
- Metric Tags
Publishing to AppOptics
The information required for publishing metrics to AppOptics by the SolarWinds Snap Agent is located in the following section:
plugins:
include: "C:/ProgramData/SolarWinds/Snap/plugins.d"
publisher:
publisher-appoptics:
all:
token: <api_token>
url: "https://api.appoptics.com/v1/measurements"
The <api_token>
contains the metrics API token.
Publishing through a proxy
SolarWinds Snap Agent can publish metrics through a SOCKS5 proxy or HTTP proxy.
Configuration proxy_url
sets the url used for accessing the proxy server. If the proxy server requires authentication, then you can specify the user by using proxy_user
and the password by using proxy_password
.
plugins:
include: C:/ProgramData/SolarWinds/Snap/plugins.d
publisher:
publisher-appoptics:
all:
token: "c6260446e584d8afcafcafcafcafcafcafc112233441128e68ef4ea3f2b289d50"
url: "https://api.appoptics.com/v1/measurements"
# Enable proxy configuration
proxy_url: "<proxy-type>://<proxy-address>:<port>"
proxy_user: <username>
proxy_password: <password>
where <proxy-type>
can be socks5
for a SOCKS5 proxy or http
for a HTTP proxy.
Proxy configuration can be also specified using ALL_PROXY
and NO_PROXY
enviroment variables.
ALL_PROXY
environment variable is used to specify the URL used for accessing the proxy.
The format for ALL_PROXY
is:
set ALL_PROXY="<proxy-type>://<user>:<password>@<proxy-address>:<port>"
or without authentication
set ALL_PROXY="<proxy-type>://proxy-address>:<port>"
NO_PROXY
environment variable is used to specify the URLs that should be excluded from proxy-ing. This should be a comma-separated list of host names, domain names, or a mixture of both. Asterisks can be used as wildcards, but other clients may not support that. Domain names may be indicated by a leading dot. NO_PROXY
environment variable is only used when ALL_PROXY
environment variable is specified.
For example:
set NO_PROXY="169.254.169.254, localhost, 127.0.0.1, .domain.com"
When running on an EC2 instance, the address 169.254.169.254
is specified to allow EC2 queries to reach local instance instead of the proxy server.
The ALL_PROXY
and NO_PROXY
environment variables can be specified at system level by going to Control Panel > Advanced System Settings > Advanced Tab > Enviroment Variables and add them under
System variables
.
ALL_PROXY="<proxy-type>://<user>:<password>@<proxy-address>:<port>"
NO_PROXY="169.254.169.254, localhost, 127.0.0.1, .domain.com"
If proxy_url
, proxy_user
, or proxy_password
are specified inside C:\ProgramData\SolarWinds\Snap\config.yaml
configuration file, their values will overwrite values specified by ALL_PROXY
environment variable.
Detecting if running on EC2 (OpenStack) instance
SolarWinds Snap Agent is able to detect if it is running on EC2 or OpenStack instance by querying Instance Metadata. By default, agent timeout for qyerying is configured to 1s.
plugins:
include: C:/ProgramData/SolarWinds/Snap/plugins.d
publisher:
publisher-appoptics:
all:
token: "c6260446e584d8afcafcafcafcafcafcafc112233441128e68ef4ea3f2b289d50"
url: "https://api.appoptics.com/v1/measurements"
ec2_check_timeout: "1s"
Publishing to a File
The C:\ProgramData\SolarWinds\Snap\plugins.d\publish-file.yaml.example
file contains the information required to publish metrics to a file for debugging purpose:
publisher:
file:
all:
file: "C:/ProgramData/SolarWinds/Snap/temp/published_metrics.log"
load:
plugin: snap-plugin-publisher-aofile.exe
Autoloading plugins and tasks
Configuration auto_discover_path
sets the directory to auto load plugins and tasks when the snapteld daemon starts up.
auto_discover_path: "C:/Program Files/SolarWinds/Snap/autoload;C:/ProgramData/SolarWinds/Snap/autoload"
After a fresh install, the SolarWinds Snap Agent will report the default system metrics .
Log level
The log_level
setting controls logging verbosity. For example, to get detailed debug level output:
# 1 - Debug, 2 - Info, 3 - Warning, 4 - Error, 5 - Fatal.
# Default value is 3.
log_level: 1
log_path: "C:/ProgramData/SolarWinds/Snap/log"
Global Tags
The SolarWinds Snap Agent generates one global tag common to all metrics named hostname
which by default will be populated with the system’s host name. You also have the option to define a hostname alias in the config file. All metrics will then report with hostname
and host_hostname_alias
tags:
plugins:
include: C:/ProgramData/SolarWinds/Snap/plugins.d
publisher:
publisher-appoptics:
all:
token: "c6260446e584d8afcafcafcafcafcafcafc112233441128e68ef4ea3f2b289d50"
url: "https://api.appoptics.com/v1/measurements"
hostname_alias: myhostname
If you want to add additional global tags you can add a tags:
section that contains global tags that are applied to all collected metrics:
plugins:
include: C:/ProgramData/SolarWinds/Snap/plugins.d
publisher:
publisher-appoptics:
all:
token: "c6260446e584d8afcafcafcafcafcafcafc112233441128e68ef4ea3f2b289d50"
url: "https://api.appoptics.com/v1/measurements"
# Set this option if you want a different "host" tag to be associated with the metrics you report.
hostname_alias: myhostname
tags:
# tags all metrics
/:
team: sre
The example above will result in three global tags: hostname
, host_hostname_alias
, and team
.
Optional Metrics
The metrics that a SolarWinds Snap Agent plugin reports are defined in the task YAML file. A task describes the how, what, and when of a SolarWinds Snap Agent job. The task files for each plugin are stored under C:\ProgramData\SolarWinds\Snap\tasks.d
. In the task file, the directive
collect:
metrics:
…describes which metrics to collect. For most of our integrations we have curated a subset of plugin metrics that we deemed the most important and have commented out the others. You'll find those metrics listed under the "Optional Metrics" section in the Integration's knowledge base article. For example, the task file for the an integration "Foo" (C:\ProgramData\SolarWinds\Snap\tasks.d\foo.yaml
) could include the following directive:
workflow:
collect:
metrics:
/foo/BytesPerSec: {}
/foo/workers/Open: {}
/foo/workers/Closing: {}
/foo/workers/Finishing: {}
/foo/workers/Logging: {}
/foo/workers/Reading: {}
#/foo/CPULoad: {}
With this configuration, the BytesPerSec
metric and five workers
metrics will be loaded whereas the CPULoad
metric will be ignored. To activate the CPULoad
metric, simply uncomment the line and restart the daemon.
Metric Tags
You can use a Tags:
section in the task YAML file to describe additional meta data for metrics. Tags can be described at the branch level, and all leaves of that branch will receive the given tag(s):
workflow:
collect:
metrics:
/foo/BytesPerSec: {}
/foo/workers/Open: {}
/foo/workers/Closing: {}
/foo/workers/Finishing: {}
/foo/workers/Logging: {}
/foo/workers/Reading: {}
#/foo/CPULoad: {}
tags:
/foo/workers:
type: worker
/foo/workers/Logging:
action: logging
With the above configuration all the workers
metrics will have the type
tag and only the Logging
metric will also have the action
tag.
When the APM Integrated Experience is enabled, AppOptics shares a common navigation and enhanced feature set with the other integrated experiences' products. How you navigate AppOptics and access its features may vary from these instructions. For more information, go to the APM Integrated Experience documentation.
The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.