Documentation forAppOptics

Configure

AppOptics Go agent supports reading configurations from both environment variables and a YAML config file. The environment variables, if defined, take precedence over the corresponding items in the config file.

Environment Variables

The AppOptics Go agent can be configured via system environment variables, there is no configuration file needed. These are the available environment variables:

Variable Name Required Default Description
APPOPTICS_SERVICE_KEY Yes   The service key identifies the service being instrumented within your Organization. It should be in the form of <api token>:<service name>.
APPOPTICS_DEBUG_LEVEL No ERROR Logging level to adjust the logging verbosity. Increase the logging verbosity to one of the debug levels to get more detailed information. Possible values: DEBUG, INFO, WARN, ERROR
APPOPTICS_HOSTNAME_ALIAS No   A logical/readable hostname that can be used to easily identify the host.
APPOPTICS_TRACING_MODE No enabled Change to disable all tracing. Possible values: enabled, disabled. Please note that the old values (always, never) are still supported for backward compatibility.
APPOPTICS_REPORTER No ssl The reporter that will be used throughout the runtime of the app. Possible values: ssl, udp
APPOPTICS_COLLECTOR No collector.appoptics.com:443 SSL collector endpoint address and port (only used if APPOPTICS_REPORTER = ssl).
APPOPTICS_COLLECTOR_UDP No 127.0.0.1:7831 UDP collector endpoint address and port (only used if APPOPTICS_REPORTER = udp).
APPOPTICS_TRUSTEDPATH No   Path to the certificate used to verify the collector endpoint.
APPOPTICS_PREPEND_DOMAIN No false Prepend the domain name to the transaction name. Possible values: true, false
APPOPTICS_DISABLED No false Disable the agent. Possible values: true, false
APPOPTICS_SQL_SANITIZE No 0

The SQL sanitization mode. Possible values:

  • 0: disabled (default)
  • 1: enable SQL sanitizing and attempt to automatically determine which quoting form to use.
  • 2: enable SQL sanitizing and force dropping double quoted characters.
  • 3: enable SQL sanitizing and force retaining double quoted character.
APPOPTICS_CONFIG_FILE No   The config file path. The agent will check the following files in order if the path is not specified: ./appoptics-goagent.yaml -> ./appoptics-goagent.yml -> /appoptics-goagent.yaml -> /appoptics-goagent.yml.
APPOPTICS_EC2_METADATA_TIMEOUT No 1000 EC2 metadata retrieval timeout value in milliseconds. A value of 0 effectively disables fetching from the metadata URL (this can me useful for apps that don't run on EC2/OpenStack in order to minimize agent startup time). Possible values: [0, 3000]
APPOPTICS_TRIGGER_TRACE No enabled Enable or disable the Trigger Trace feature. Possible values: enabled (default), disabled.
APPOPTICS_RUNTIME_METRICS No true Collect and send Go runtime metrics to the reporter. Possible values: false, true (default)
APPOPTICS_PROXY No   The URL of the HTTP/HTTPS proxy in the format of scheme://<username>:<password>@<host>:<port>, where scheme determines the agent-to-proxy connection type (http or https) and username/password are used for Basic authentication against the proxy. See the proxy section for more information.
APPOPTICS_PROXY_CERT_PATH No   The path to the proxy cert file. See the proxy section for more information.

Config File

The agent supports reading configurations from YAML config file. Most of the items in the config file have corresponding environment variables. All the items are optional and the config file is not mandatory as the default values are normally good to go. However, the service key must be defined either in the config file or via the environment variable.

Define the environment variable APPOPTICS_CONFIG_FILE to specify the path of your own configuration file or use one of the default locations (see the description of APPOPTICS_CONFIG_FILE above). You may create your file by modifying the example configuration file.

Transaction Filtering

The instrumentation of a particular web transaction can be enabled or disabled explicitly. This is done by filtering the transaction's request URL via regular expessions or extensions defined in the TransactionSettings configuration option, which is only supported via the YAML config file.

You may define either RegEx (regular expression) or Extensions (URL extensions) for a particular URL pattern, but not both.

If the request URL matches one of the above criteria, the tracing mode specified via the Tracing key (valid values are enabled or disabled) will take precedence over the service-level tracing mode.

For example, the following configuration can be used to disable traces and metrics for the URL http://test.com/user123 and enable traces and metrics for http://test.com/logo.jpg.

Copy
TransactionSettings:
- Type: url
  RegEx: \s+\d{3}
  Tracing: disabled
- Type: url
  Extensions:
- .jpg
  Tracing: enabled

HTTP/HTTPS Proxy

The Go agent reports data to the AppOptics backend (aka collector) via gRPC secured with TLS. This suports HTTP/HTTPS proxying in two different ways:

  1. Use the global environment variables HTTP_PROXY, HTTPS_PROXY, NO_PROXY.

    This is supported natively by the gRPC library. You may use these environment variables if you don’t need a separate proxy configuration for the Go agent.

  2. Use the Go agent's specific configuration option APPOPTICS_PROXY (and APPOPTICS_PROXY_CERT_PATH for an HTTPS agent-to-proxy connection scheme) or the corresponding configuration file options Proxy and ProxyCertPath.

    You may specify a proxy configuration specific to just the Go agent this way. The global environment variables above will be ignored if APPOPTICS_PROXY or Proxy is configured. This option supports Basic authentication and HTTPS connection to the proxy.

Please note that the proxied connection to the collector will always be secured with TLS regardless of the agent-to-proxy connection type, and that proxying only applies to the gRPC connections between the agent and the collector – when the agent makes direct HTTP requests to retrieve EC2 instance metadata all proxy settings are bypassed.

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.