Enabling Monitoring and Logging of Mobile Platform Components

In this article:

Monitoring of Mobile Platform Components

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 on cluster, the system uses preinstalled applications - Prometheus and Grafana in OpenShift.

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. Set variables 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.

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

Variables for creating a data source in Grafana:

Variables 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, set the variable on installing or updating mobile platform using Helm Values:

--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:

Preparation and Deployment of Fault-Tolerant Cluster Based on OKD/OCP