Configuring Grafana for application network traffic
To view the application network traffic metrics for your gateways in Grafana, you must first install and configure it. After you install Grafana, you configure your Grafana dashboard and data source.
Prerequisites
- Install Grafana. For installation instructions, see Install Grafana.
Important: Grafana 9.2.x or later is required.
- Use the Grafana provisioning feature to configure your Grafana dashboard and data source. See Provision Grafana and Provision dashboards and data sources.
Configuring Grafana on Linux®
Complete the following steps:
- Configure the following environment variables for Grafana:
MDM_API_KEYandMDM_SERVICE_URL.MDM_API_KEYis used to authenticate the tenant in the data source. The API key is needed for any user that needs read access to all the Mesh resources. To generate your API key, see Creating API keys by using the Mesh console. - On Linux, Grafana uses a specific
EnvironmentFile, which is set to/etc/sysconfig/grafana-server. Add the environment variables to this file. Use the following example settings as a guide:MDM_API_KEY=xxxxxxxxxxxxxx MDM_SERVICE_URL=https://app.hybridcloudmesh.ibm.com/api/v1/metrics - Provision Grafana with a data source and a dashboard. Put the following configuration files in the specified directories:
- To create a data source, place the Data source configuration file in
/etc/grafana/provisioning/datasources/. - To configure a dashboard, place the Dashboard configuration file in
/etc/grafana/provisioning/dashboards/.
- To create a data source, place the Data source configuration file in
- To create a dashboard for Red Hat® Service Interconnect® gateways, put the Service Interconnect edge dashboard configuration file in
/var/lib/grafana/dashboards/. - Restart the Grafana instance.
Configuring Grafana in Docker
Complete the following steps:
- Export the following variables to the Docker container and include the configurations in the Grafana configuration for the container:
MDM_API_KEY=xxxxxxxxxxxxxx MDM_SERVICE_URL=https://app.hybridcloudmesh.ibm.com/api/v1/metricsFor information about mounting volumes, see Start a service with volumes. For information about passing environment variables to containers, see Explore ways to set environment variables.
- Provision Grafana with a data source and a dashboard. Use volume mounting to include the following configuration files in the container's Grafana configuration:
- To create a data source, place the Data source configuration file in
/etc/grafana/provisioning/datasources/. - To configure a dashboard, place the Dashboard configuration file in
/etc/grafana/provisioning/dashboards/.
- To create a data source, place the Data source configuration file in
- To create a dashboard for Red Hat Service Interconnect gateways, use volume mounting to include the Service Interconnect edge dashboard configuration file in the container's Grafana configuration in
/var/lib/grafana/dashboards/. - Restart the Grafana instance.