Running a project usually involves a production deployment, multiple development setups, and, in a continuous pipeline setup, multiple staging, QA and review installations. Keeping all these different environments under monitoring without interfering with each other requires a tailored monitoring tool, such as Tideways, with built in multi-environment support — available on all plans.
Production and non-production environments operate differently.
Production environments collect more traces, store more event details, and retain data as per plan limits. Non-production environments, however, collect a reduced quantity of data. More details are available below.
Environments allow you to collect performance data and traces from different "environments" of your project. For example, data is kept separate to avoid interference of testing data with production data. Comparing them is supported to find performance regressions before they get into production.
Each project has a limit on the number of active environments that can report performance and trace data to Tideways. If you create more environments than this limit, then only the most recently activated environments are marked as active and collect data.
The "production" environment is a special case, however, because it is always active and never gets de-activated when too many other environments are created.
When a non-production environment gets created during the ingestion of performance or tracing data, then it gets activated forever.
Each active non-production environment gets assigned up to 10% of the traces/minute quota, so for a basic project with 25 traces/minute an environment gets 2 traces assigned. The non-production environments only collect application monitoring data and no detailed transaction level percentile monitoring data. The detail of traces is not limited for non-production environments. Servers running in an inactive environment discard all their data at the daemon level automatically.
Environments are available in Basic, Standard and Pro plans, lower plans only ship with the built-in "production" environment and a limited "development" environment to collect manually triggered traces.
To switch between environments in the application’s Performance Overview dashboard, click the environment that you want to view data for in The Service and Environment Switcher.
In the example below there are two environments to choose from:
By default each daemon assumes it is running for the
production environment of the project.
You can pass the
--env flag to start the daemon for a different environment, by creating or modifying the configuration file
/etc/default/tideways-daemon to contain:
# File: /etc/default/tideways-daemon # Change "staging1" below as desired. The default is "production" TIDEWAYS_DAEMON_EXTRA="--env=staging1"
|Make sure to restart the daemon, if you make this change.|
The log file
/var/log/tideways/daemon.log should then contain a hint about the environment used:
See the Daemon Reference Documentation for more information.
You can see a list of all environments, create new ones, and toggle which environments are active, from.
To create a new environment, click Create Environment in the top right-hand corner of the Environments section, which takes you to the "Create Environment" form.
When there, specify the name and active period (Active For) for the new environment, and click Create Environment. Environments can be active for forever, an hour, a day, or a week.
After that, you will be redirected back to the Environments list, where you will see the new environment in the list of available environments, already activate.
To deactivate an active environment, click Deactivate on the far right-hand side of its row in the environment’s list.
After doing so, you’ll see its status change to
To edit an existing environment, click
(Edit) in the
Production column for that environment.
After doing so, you will be on the "Promote Environment development" form. From there, you can promote the environment to production, and assign 0, 5, 10, 25, and 50 extra traces per/minute to the environment.
After setting the respective values in the form, click Change Environment Settings to apply the changes, and you will be back at the Environments list.
After updating the daemon configuration and restarting the daemon, the daemon’s log file (
/var/log/tideways/daemon.log) should show that the environment is in use.
The new environment will be created as soon as a daemon collects data for it.
In the following example, on line three, you can see that the environment in use is
2017/09/14 13:48:05 Starting up daemon (version 1.5.9) 2017/09/14 13:48:05 Sending to https://app.tideways.io 2017/09/14 13:48:05 Sending for Environment 'staging1' 2017/09/14 13:48:05 Collecting for demo.tideways.io 2017/09/14 13:48:05 Supported server stats: CPU [X] Memory [X] Load [X] Disk [X] Network [X] 2017/09/14 13:48:05 Listening for Unix Socket connections at /var/run/tideways/tidewaysd.sock. 2017/09/14 13:48:05 Listening for UDP connections 127.0.0.1:8135
See the Tideways Daemon configuration reference documentation for more information. Environments are then automatically created inside Tideways as soon as a daemon collects data for them. You can see a list of all environments, create new ones and toggle which ones are active from the "Project Settings" and then "Configure Servers & Environments" screen.
The most common use-case for the environment feature is a permanently running staging application that is running an unstable version of your project. You can run Tideways on this staging deployment and collect all data into a single environment.
If you are using an existing PaaS (Platform as a Service) or have built a review pipeline yourself (for example with Jenkins and Docker), then, for example, you can use Tideways to create on-demand environments for every newly created build that is based on a pull-request in GitHub for example.
The idea is that you use the
TIDEWAYS_ENVIRONMENT to set the environment name to the review environment name, for example
With the active environment limitation, Tideways selects the most recent environments to collect data for you so that you always get data for the most recently created builds.
You can then check for performance regressions by running automated load-tests against these environments and checking the results from Tideways.