Configuration for Go


You can adjust Sqreen settings according to your needs. This section lists the possible configuration options you have with the Sqreen Go agent.

Configuration sources

The Sqreen agent reads its configuration from different locations. This is the order of precedence:

  1. Environment variables
  2. A sqreen.yaml file
  3. Default configuration options

You can store the sqreen.yaml file in:

  • Your application top level directory
  • In a custom location set by SQREEN_CONFIG_FILE environment variable:
export SQREEN_CONFIG_FILE=/custom/path/sqreen.yaml

Configuration variables

Find your organization token by going to Account Settings > Tokens in your Sqreen dashboard, or (https://my.sqreen.com/profile/organization/tokens). Your token has the prefix org_.

To help Sqreen identify the application when you use an organization token, you also need to set a unique application name.

You can provide this information using the SQREEN_TOKEN and SQREEN_APP_NAME environment variables.

When using the application token, only the SQREEN_TOKEN is required.

Application tokens deprecated

Application tokens are unique to an application. Organization tokens are available throughout the organization your account belongs to.

While Sqreen will continue to support application tokens for backward compatibility in the short term, they are now deprecated, and we encourage you to convert your applications to use organization tokens as soon as possible.

Follow this how-to to migrate applications using an application token.

Find your organization token by going to Account Settings > Tokens in your Sqreen dashboard, or (https://my.sqreen.com/profile/organization/tokens). Your token has the prefix org_.

To help Sqreen identify the application when you use an organization token, you also need to set a unique application name.

Env variable name Role YAML key name Default value
SQREEN_DISABLE Disable Sqreen when not empty. disable Empty
SQREEN_TOKEN The Sqreen token. This identifies the agent to Sqreen backend servers token Empty
SQREEN_APP_NAME The application name as displayed within the Sqreen dashboard app_name Empty
SQREEN_CONFIG_FILE Custom location for the JSON based config Empty
SQREEN_LOG_LEVEL Agent logging level log_level info
SQREEN_PROXY HTTPS proxy address to use proxy Empty
SQREEN_IP_HEADER Specify the header to use to find the real IP address of a client ip_header Empty
SQREEN_IP_HEADER_FORMAT Specify the value format of the configured header SQREEN_IP_HEADER to find the real IP address of a client. For now, it only supports %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid. ip_header_format Empty
SQREEN_STRIP_HTTP_REFERER Disable sending the HTTP header Referer to Sqreen when not empty. strip_http_referer Empty

Configuring multiple environments

Typically you install the Sqreen agent in your production environment, but you can create several applications by specifying the environment in the application name.

# Include the environment into the app_name
app_name: "Your Service Name (development)"
token: "Your Token"