-[Grafana dashboard for monitoring service-related metrics](#grafana-dashboard-for-monitoring-service-related-metrics)
-[1. Add a new variable for the service in Grafana Dashboard](#1-add-a-new-variable-for-the-service-in-grafana-dashboard)
-[2. Add row and panels in the dashboard for the new service](#2--add-row-and-panels-in-the-dashboard-for-the-new-service)
This guide contains all frontend-related aspects that need to be enhanced for integrating a new service in the MEC Sandbox. These include:
@@ -37,4 +39,64 @@ A correct MEC Service base path for the new service is also displayed in the _Tr
## Grafana dashboard for monitoring service-related metrics
**TODO**
The 'MEC Sandbox' Grafana dashboard is provisioned using the `mec-sandbox/config/dashboards/mec-sandbox.json` file which is hosted in the [MEC Sandbox repository](https://forge.etsi.org/rep/mec/mec-sandbox).
In order to display metrics related to the new service in the dashboad, the JSON file will need to be modified. All the necessary steps that need to taken are mentioned below.
> **NOTE:** Grafana will be able to fetch required metrics from Prometheus only if metrics collection is enabled for the new service. See how to enable metrics collection [here](./development-guide.md#server-side).
### 1. Add a new variable for the service in Grafana Dashboard
As a first step, add a variable for the new service that will be used in the JSON file for making target promQL queries by Grafana. This will be done by adding another array item in `templating.list`.
This variable should be assigned the same value as the 'constant' `serviceName` in `<mec-identifier>.go` file. For example, Grafana variable `mec030` for MEC030 V2X Information Service will have a value of _V2XI Service_ as is defined in the `vis.go` file for the MEC030 serivce:
```go
...
constserviceName="V2XI Service"
...
```
Therefore, the new entry in `templating.list`, which is specific to MEC030, will look like this:
```JSON
{
"allValue": null,
"current": {
"selected": false,
"text": "V2XI Service",
"value": "V2XI Service"
},
"error": null,
"hide": 2,
"includeAll": false,
"label": null,
"multi": false,
"name": "mec030",
"options": [
{
"selected": true,
"text": "V2XI Service",
"value": "V2XI Service"
}
],
"query": "V2XI Service",
"skipUrlSync": false,
"type": "custom"
}
```
> **NOTE:** Append the new variable, `mec030` for example, in the target queries wherever combined metrics for all MEC services are being collected.
### 2. Add row and panels in the dashboard for the new service
A new "row" will need to be added in the 'MEC Sandbox' dashboard for hosting different panels that will display metrics collected by Prometheus related to HTTP requests and notifications for that specific MEC service.
The row can be added by appending one new entry in the `panels` array. Furthermore, the panels for displaying Requests and Notifications related metrics that will be hosted under the row can be added in the nested `panels` attribute of the new array item.
The `gridPos` attribute will need to be configured carefully. Notice the grid positions of the above two rows (and their panels) for reference and set your values accordingly.
Furthermore, it is **important** to assign unique IDs for the new panels in the `id` section of each panel.
Use the variable defined in the previous step in the promQL expression under `panels.targets.expr` section.
> Consult the existing `panels` array entries specified for other MEC services to get more information on how to populate the necessary attributes.