The OpenShift® administrator can create the Grafana Data Source to point to the Prometheus instance, and pull the data from the Prometheus instance into the Grafana dashboards.
Procedure
- Log in to the OpenShift Container Platform (OCP) by using the OpenShift administrator credentials.
- In the left panel, go to
. Select the project where you installed Grafana
operator.
- Click the Grafana Operator link from the
Name column, and click the Grafana Data Source
tab.
- Click Create GrafanaDataSource.
- Enter the following details in the YAML file:
- name: Enter the name of the Grafana Data Source. Refer to the example,
wherein the Grafana Data Source name is entered as
example-grafanadatasource.
- namespace: Enter the name of the project or the namespace where you
installed Grafana operator. Refer to the example, wherein the Grafana namespace name is entered as
test01.
- url: Enter the Prometheus route URL.
Example:
apiVersion: integreatly.org/v1alpha1
kind: GrafanaDataSource
metadata:
name: example-grafanadatasource
namespace: test01
spec:
datasources:
- access: proxy
editable: true
isDefault: true
jsonData:
timeInterval: 5s
name: Prometheus
type: prometheus
url: <Prometheus route URL>
version: 1
name: example-datasources.yaml