-
Notifications
You must be signed in to change notification settings - Fork 0
Kibana dashboard to view MSPDirect logs
The MSPDirect application's backend component and database outputs application logs to log files. However accessing these logs files through OpenShift is cumbersome. To make the process easier, the output of these logs is also pushed to the console. Users with the appropriate access can view the console output in Kibana. This page provides information on:
- How to access Kibana dashboard
- How to view the application logs
- How to search for specific logs
Users can access the Kibana dashboard using the same credentials as OpenShift platform either via OpenShift web console or directly via URL: https://kibana-openshift-logging.apps.silver.devops.gov.bc.ca/app/kibana. All users with access to MSPDirect project in OpenShift get access to the Kibana dashboard.
After logging in to Kibana platform, Users can import the MSPDirect application and database dashboards via:
Management --> Saved Objects --> Import --> Select file: moh-hnweb\openshift\kibana-resources\mspdirect-backend-dashboard.json
Management --> Saved Objects --> Import --> Select file: moh-hnweb\openshift\kibana-resources\mspdirect-database-dashboard.json
After import is successful, users can check the logs via these dashboards.
The MSPDirect backend dashboard contains 4 visualizations:
- MSPDirect-backend-all-logs: This visualization fetches log messages from all pods by using 'mspdirect-backend-all-logs' search Objects. This search object gets messages from all pods with labels as 'mspdirect-backend', 'mspdirect-backend-uat', 'mspdirect-backend-test' and 'mspdirect-backend-dev' within the selected timeframe. Users can expand the logs view by clicking ellipsis at top right of this panel.
- metric-MSPDIRECT-all-messages: This visualization shows total number of log messages in selected timeframe.
- metric-MSPDIRECT-logs-per-pod: This visualization provides break up of number of messages for each pod in selected timeframe. Users can click on a value to see messages from that pod.
- pie-MSPDIRECT-backend-logs-type: This visualization provides a pie chart for type of messages (info, debug, warning, error). Users can click on any section of chart to see just those messages.
By default the timeline in Kibana dashboard is 15 minutes. You can change the value via 'Time range' at top right corner of the page.
The MSPDirect database dashboard contains 1 visualization:
- MSPDirect-database-all-logs: This visualization fetches log messages from all pods by using 'mspdirect-database-all-logs' search Objects. This search object gets messages from all of patroni databases of MSPDirect application (dev, test, uat and prod) within the selected timeframe. Users can expand the logs view by clicking ellipsis at top right of this panel.
Kibana filter provides additional capabilities to search for specific logs for instance logs from a specific pod or all pods from same application. Users can add a filter to search for specific logs in the dashboard. There are number of options available in filter criteria ranging from kubernetes fields to kibana fields. Feel free to use any filter. This will not update the dashboard unless users 'Save' dashboard after adding any filter.
For example, if users want to view backend logs for uat environment, they can add this filter in dashboard: kubernetes.flat_labels is app=mspdirect-backend-uat
For backend logs, users can pick any of these labels: app=mspdirect-backend, app=mspdirect-backend-uat, app=mspdirect-backend-test, app=mspdirect-backend-dev.
*app=mspdirect-backend represents prod environment.
For database logs, labels are: app=mspdirect-prod-patroni, app=mspdirect-uat-patroni, app=mspdirect-test-patroni, app=mspdirect-dev-patroni
Kibana platform persists logs from the last 14 days only. For any older logs, users can connect with respective pod terminal and view the log files from logs folder.