Skip to content

Commit

Permalink
Update 06-configuring-services.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andriitserkovnyi committed Jan 10, 2023
1 parent ecb80ce commit 9a605f8
Showing 1 changed file with 93 additions and 23 deletions.
116 changes: 93 additions & 23 deletions docs/06-configuring-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,65 +361,135 @@ You can pass the server details only with the `docker/sdk up` command.
It is not obligatory to pass all the details as environment variables or define all the details in the deploy file. You can pass the details in any combination.

## New Relic
[New Relic](https://newrelic.com/) is a tool used to track the performance of services, environment to quickly find and fix issues.

The solution consists of a client and a server. The client is used to collect the data about applications in an environment and send it to the server for further analysis and presentation. The server is used to aggregate, analyse and present the data.
[New Relic](https://newrelic.com/) is a tool used to track the performance of services and the environment to quickly find and fix issues.

### Configuration
The solution consists of a client and a server. The client is used to collect data about applications in an environment and send it to the server for further analysis and presentation. The server is used to aggregate, analyse, and present the data.

Follow the steps to enable New Relic:
### Prerequisites

1. Adjust `deploy.*.yml` in the `docker:` section:
* Access to New Relic with an APM account.
* Local: [New Relic license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/).
* The New Relic module.

```yaml
docker:
newrelic:
license: {new_relic_license}
Spryker provides its own New Relic licenses for use with its PaaS environments. A New Relic license key is only required if you wish to set up your own local monitoring.

### Install the New Relic module

While most environments come with New Relic already available, you may need to add the module to your project. Add the module to your `composer.json`:

```bash
composer require spryker-eco/new-relic
```

2. Adjust `deploy.*.yml` in the `image:` section:
### SCCOS: Configure New Relic

1. Adjust `deploy.*.yml` in the `image:` section:

```yaml
image:
tag: spryker/php:7.3 # the image tag that has been previously used in `image:`
tag: spryker/php:7.4 # the image tag that has been previously used in `image`
php:
...
enabled-extensions:
...
- newrelic
```

### Alternative Configuration
2. Push and deploy the changes using one of the following guides:

* [Deploying in a staging environment](https://docs.spryker.com/docs/cloud/dev/spryker-cloud-commerce-os/deploying-in-a-staging-environment.html)
* [Deploying in a production environment](https://docs.spryker.com/docs/cloud/dev/spryker-cloud-commerce-os/deploying-in-a-production-environment.html)



3. Submit an infrastructure change request via the [Support Portal](https://docs.spryker.com/docs/scos/user/intro-to-spryker/support/how-to-use-the-support-portal.html).
We will confirm that a New Relic APM account is available for you and ensure that the correct application naming convention is set up to cascade to the appropriate APM.

Once New Relic is enabled, in the New Relic dashboard, you may see either `company-staging-newrelic-app` or `YVES-DE (docker.dev)`. New Relic displays these APM names by the application name setup in the configuration files.

![screenshot](https://lh3.googleusercontent.com/drive-viewer/AJc5JmRPsydm6Ds2eRmKS_lMRNjBnqhBLsvtN_ul_R1EMO7Z4pj74Mbpw3kMdAnjH6gIwLt9cvOqLcI=w1920-h919)


{% info_block infoBox %}

If you update the name of an application, [contact support](https://docs.spryker.com/docs/scos/user/intro-to-spryker/support/how-to-use-the-support-portal.html) to update the changes in your APM.

{% endinfo_block %}

Use this configuration if you are going to change New Relic license often or don’t want to define it in the deploy file.

Follow the steps to enable New Relic:

1. Adjust `deploy.*.yml` in the `docker:` section:
### Local: Configure New Relic

1. In `deploy.*.yml`, adjust the `docker` section:

```yaml
docker:
newrelic:
license: {new_relic_license}
distributed tracing:
enabled: true
```

2. Adjust `deploy.*.yml` in the `image:` section:
2. In the `deploy.*.yml`, adjust the `image` section:

```yaml
image:
tag: spryker/php:7.3 # the image tag that has been previously used in `image:`
tag: spryker/php:7.4 # the image tag that has been previously used in `image`
php:
...
enabled-extensions:
...
- newrelic
```

3. Pass the New Relic license:
### Configure YVES, ZED, and GLUE as separate APMs

```bash
NEWRELIC_LICENSE={new_relic_license} docker/sdk up
By default, in the New Relic dashboard, the APM is displayed as `company-staging-newrelic-app`. To improve visibility, you may want to configure each application as a separate APM. For example, `YVES-DE (docker.dev)`.

To do it, adjust the Monitoring service in `src/Pyz/Service/Monitoring/MonitoringDependencyProvider.php`:

```php
<?php declare(strict_types = 1);
/**
* This file is part of the Spryker Commerce OS.
* For full license information, please view the LICENSE file that was distributed with this source code.
*/
namespace Pyz\Service\Monitoring;
use Spryker\Service\Monitoring\MonitoringDependencyProvider as SprykerMonitoringDependencyProvider;
use SprykerEco\Service\NewRelic\Plugin\NewRelicMonitoringExtensionPlugin;
class MonitoringDependencyProvider extends SprykerMonitoringDependencyProvider
{
/**
* @return \Spryker\Service\MonitoringExtension\Dependency\Plugin\MonitoringExtensionPluginInterface[]
*/
protected function getMonitoringExtensions(): array
{
return [
new NewRelicMonitoringExtensionPlugin(),
];
}
}
```
:::(Warning) (Note)
You can pass the New Relic license only with the `docker/sdk up` command.
:::

{% info_block infoBox %}

* Some builds have the Monitoring service built into the Yves application. If `src/Pyz/Service/Monitoring/MonitoringDependencyProvider.php` does not exist, you may want to check `src/Pyz/Yves/Monitoring/`.

* If the class is missing from the Monitoring service, create it.


{% endinfo_block %}



With `new \SprykerEco\Service\NewRelic\Plugin\NewRelicMonitoringExtensionPlugin()` being returned with the `getMonitoringExtensions()` function, the Monitoring class includes New Relic. Now applications are displayed as separate APMs, and an appropriate endpoint or class is displayed with each transaction.
![screenshot](https://lh3.googleusercontent.com/drive-viewer/AJc5JmTs7PzBBgaotIid707cuXeru3hc5L6PZv9a_zQAyDMhp2FWKiCSTc2kmqHCaLVsBtjIcoUVYKY=w1920-h919)
## Webdriver
PhantomJS is provided as a webdriver service by default, but you can switch to ChromeDriver as described below.
Expand Down

0 comments on commit 9a605f8

Please sign in to comment.