Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions EndToEndExamples/DASHBOARD.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
# Importing the Grafana Dashboard

Before you import the dashboard, you need to update the `grafana.json` file for your environment:
Before you begin the process of importing the Grafana dashboard, make sure you have the following prerequisites:
- The SAS Event Stream Processing and Grafana services running on the same cluster.
- The SAS Event Stream Processing Data Source Plug-in for Grafana installed and configured. For more information, see [SAS Event Stream Processing Data Source Plug-in for Grafana](https://github.com/sassoftware/grafana-esp-plugin/blob/main/README.md#add-the-sas-event-stream-processing-data-source).
- A data source configured in Grafana for the SAS Event Stream Processing Studio application. For more information, see [Add the SAS Event Stream Processing Data Source](https://github.com/sassoftware/grafana-esp-plugin/blob/main/README.md#add-the-sas-event-stream-processing-data-source).
- The Example ESP Project has been installed onto the SAS Event Stream Processing Studio application and is running in test mode. For more information, see [Using the Examples](../README.md#using-the-examples).

Comment thread
mtlljm marked this conversation as resolved.
Before you import the dashboard, you must update `grafana.json` for your environment because the ESP Server connection URL is different in each cluster.

1. Download the `grafana.json` file to your system.
2. Update any placeholders in the dashboard file. Depending on your data source, follow the appropriate steps:
- If you are using an internal discovery service, replace all instances of `%NAMESPACE%` with the Kubernetes namespace where SAS Event Stream Processing and Grafana are running. You can do this manually or through your command line interface (CLI).
- For PowerShell, use the following command:
2. Find the Kubernetes namespace where SAS Event Stream Processing and Grafana are running.
3. You can get the namespace from SAS Event Stream Processing Studio or from your command line interface (CLI).
- In ESP Studio, open a project. In the toolbar, open the `ESP server` drop-down list. The namespace appears next to the Kubernetes Cluster icon.
- In a CLI, use the following command:
```
kubectl get deployment sas-event-stream-processing-studio-app -o jsonpath="{.metadata.namespace}"
```
4. Replace all instances of `%NAMESPACE%` with the Kubernetes namespace.
5. You can do this manually or through your command line interface (CLI).
- For PowerShell, use the following command:
```
(Get-Content grafana.json) -replace '%NAMESPACE%', 'your-namespace' | Set-Content grafana.json
```
- For bash, use the following command:
- For bash, use the following command:
```
sed -i 's/%NAMESPACE%/your-namespace/g' grafana.json
```
- If you are using an external discovery service URL, replace all instances of `%DOMAIN%` with the domain name where your ESP Project is running. You can do this manually or through your CLI.
- For PowerShell, use the following command:
```
(Get-Content grafana.json) -replace '%DOMAIN%', 'my.server.com' | Set-Content grafana.json
```
- For bash, use the following command:
```
sed -i 's/%DOMAIN%/my.server.com/g' grafana.json
```

After you have updated your `grafana.json` file, you must import the dashboard into Grafana:

1. In Grafana, select **Dashboards** from the navigation bar.
2. Click **New**.
3. From the drop-down list, select **Import**.
4. Click **Upload dashboard JSON file** and select your updated `grafana.json` file.
5. Click **Import**.
5. Enter a Name for the dashboard.
6. Select a Folder for the dashboard.
7. If required, change the Unique identifier (UID) by clicking the **Change uid** button and giving the dashboard a unique identifier.
8. From the SAS Event Stream Processing Datasource drop-down list, select the datasource that you configured with the SAS Event Stream Processing Studio application.
9. Click **Import**.