﻿# Enable monitoring parameters in BRIX On-Premises

> [HTML Version](enable-monitoring-enterprise.html)

The process of enabling monitoring for the BRIX application consists of three steps:

1. [Install monitoring tools](#installation-tools-monitoring).

2. [Make changes to the configuration file values-brix365.yaml](#alteration-config-file).

3. [Apply monitoring parameters for BRIX](#applying-parameters-monitoring).

## Step 1: Install monitoring tools

The installation of monitoring tools implies the deployment in the Kubernetes cluster of Prometheus for time series storage and Grafana for visualization. If you already have Prometheus and Grafana deployed, you can skip this step.

You can install monitoring tools in your Kubernetes cluster. For more details, see [Install monitoring tools](install-monitoring-tools.md).

## Step 2: Make changes to the configuration file values-brix365.yaml

````
Начало внимание

````
Before editing the \[OBJECT\] file, make a backup copy of it, as incorrect parameter settings may cause BRIX application malfunction.

````
Конец внимание

````
Fill out the \[OBJECT\] configuration file to enable monitoring:

1. To enable monitoring support, specify \[OBJECT\] in parameter \[OBJECT\].

2. Enable the installation in the Kubernetes cluster of ServiceMonitor for BRIX application services by specifying \[OBJECT\] in the \[OBJECT\] parameter.  
  
By default, only the basic metrics of BRIX services are given. Providing all metrics is disabled to prevent the monitoring system from being overwhelmed by too many metrics. To enable the provision of a significantly larger number of metrics by the BRIX application services, specify \[OBJECT\] in the \[OBJECT\] parameter.  
  
Within the scope of this article, enabling the provision of all metrics is not required.

Additional parameters for ServiceMonitor

  
By default, all ServiceMonitors are used for monitoring. You can exclude data collection from certain ServiceMonitors or configure data redirection to different Prometheus instances using labels. To do this, use the parameters: 

- \[OBJECT\]. It adds or overwrites labels for ServiceMonitor.

- \[OBJECT\]. Applied before scanning targets to their labels in order to:

	- Filter targets, e.g. to keep only those that have a certain label.

	- Edit target labels, for example, to add, remove or modify \[OBJECT\] labels obtained from the Service Discovery tool.

	- Dynamically define scrape parameters, such as path or port.

- \[OBJECT\]. Applied to metric labels after they have been collected, but before they are saved in Prometheus, in order to:

	- Remove unnecessary metrics.

	- Modify the labels of collected metrics, e.g., for aggregation or simplification.

	- Filter sensitive data.

3. If the Kubernetes cluster is deployed on the Deckhouse platform, set the \[OBJECT\] value in the \[OBJECT\] parameter. This will configure the supplied monitoring tools for the target platform.

4. To install Dashboards (ConfigMap) in the Kubernetes cluster for BRIX application services, specify \[OBJECT\] in the \[OBJECT\] parameter.

5. If the installation of alerts is needed, set \[OBJECT\] for \[OBJECT\]. This will start the installation of PrometheusRule (CRD) in the Kubernetes cluster for BRIX application services.

6. To configure trace routing, use the \[OBJECT\] (highest priority, direct sending to the collector) or \[OBJECT\] (sending via the Jaeger agent) parameter. If these settings are not specified, traces will be automatically sent to port \[OBJECT\] of the local node.

````
global:  
  ...  
  monitoring:  
    enabled: true  
    metrics:  
      enabled: true  
      all: false  
    provisioner: "k8s"  
    dashboard:  
      enabled: true  
    alerts:  
      enabled: false  
    jaegerAgentAddress: "jaeger-agent.monitoring.svc.cluster.local:5775"  
    jaegerCollectorEndpoint: "http://tempo.monitoring.svc.cluster.local:14268/api/traces"

7. ````
To enable [export of system performance metrics](export-monitoring-enterprise.md) to the Prometheus storage for data visualization using Grafana, set \[OBJECT\] for \[OBJECT\].

````
global:  
  ...  
  monitoring:  
    enabled: true  
    metrics:  
      enabled: true  
      all: false  
    provisioner: "k8s"  
    dashboard:  
      enabled: true  
    alerts:  
      enabled: false  
...

## ````
Step 3: Apply monitoring parameters for BRIX

You can update monitoring parameters for BRIX in two ways: online and [offline](#offline-update).

### Update parameters online

1. Determine the version of the chart with which the BRIX application was installed or updated:

````
helm show chart brix365/brix365

````
Example of command execution:

**[![enable-monitoring-enterprise-1](enable-monitoring-enterprise-1.png)]**

After the command execution, you see the chart version information in the \[OBJECT\] string. Save this value for the next step.

2. Update the parameters using the \[OBJECT\] configuration file. To do this, execute the following command specifying the installed chart version for the \[OBJECT\] flag instead of \[OBJECT\]:

````
helm upgrade --install brix365 brix365/brix365 -f values-brix365.yaml --version <brix365-chart-version> --timeout=30m --wait \[-n namespace\]

### ````
Update parameters offline

Go to directory with downloaded BRIX chart and run the following command:

````
helm upgrade --install brix365 ./brix365 -f values-brix365.yaml --timeout=30m --wait \[-n namespace\]

````
It takes about 10-30 minutes to update the parameters. Wait for it to complete.