In this article:

Monitoring of Mobile Platform Components

Logging of Mobile Platform Components

Enabling Monitoring and Logging of Mobile Platform Components

To work with mobile platform components, enable monitoring and/or logging of components if required:

Monitoring of Mobile Platform Components

To monitor mobile platform components in cluster, the system uses preinstalled applications - Prometheus and Grafana in OpenShift.

If the Deckhouse cluster is used, before setting up component monitoring check, under which user the mobile platform is installed and updated. Grant permissions for the user if it is not kubeadmin:

sed "s/FMP_USER/<user name>/g" ./rbac/grafana-role-binding.yaml | oc apply -f -

To monitor mobile platform components:

NOTE. If the Grafana application has been already installed, go to Step 4.

  1. Create a configuration for the Prometheus application in the cluster terminal, which will be used to request data from user services:

cat <<EOF | oc apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
  name: cluster-monitoring-config
  namespace: openshift-monitoring
data:
  config.yaml: |
    enableUserWorkload: true
EOF
  1. Create a namespace for the Grafana application:

oc create namespace fmp-monitoring
  1. Install the Grafana application:

helm install -n fmp-monitoring fmp-grafana \
   ./grafana/grafana-5.2.9.tgz \
   -f ./grafana/values.yaml \
   --set ingress.hostname=grafana.${CLUSTER_HOST}

Where:

  1. Set access permissions for cluster monitoring when working with the Prometheus application:

oc adm policy add-cluster-role-to-user cluster-monitoring-view -z fmp-grafana -n fmp-monitoring

A Service Account for Grafana named fmp-grafana has been created automatically.

  1. Get the token that allows for the use of Prometheus:

PROMETHEUS_TOKEN=$(oc serviceaccounts get-token -n fmp-monitoring fmp-grafana)
  1. Add parameters to the command on installing or updating mobile platform to create a data source in the Prometheus application and working areas in the Grafana application.

NOTE. If the Grafana application has already contained a data source, create only working areas.

Parameters for connecting to Grafana if the Grafana application has been already installed:

Parameters for creating a data source in Grafana:

Parameters for creating working areas in Grafana:

After executing the operations, monitoring of mobile platform components is enabled. Open the Grafana application to view metrics collected for mobile platform components and to display their change in time.

The example of displaying CPU resources usage:

For details about working with the Grafana application see the Checking System Resource Volume Usage in Grafana section.

Logging of Mobile Platform Components

Centralized logging of mobile platform resources can be executed by preinstalled applications - fluentd and Kibana. The fluentd application allows for collecting logs in the Elasticsearch search engine built-in Foresight Mobile Platform.

To log mobile platform components, add the fluentd.enabled parameter with the true value to the command on installing or updating mobile platform by means of:

--set fluentd.enabled=true

After executing the operation, logging of mobile platform components is enabled.

To view and export technical logs, see the System Error Monitoring section.

See also:

Installing and Setting Up Foresight Mobile Platform | Setting Up the Number of Displayed Credentials