-
Notifications
You must be signed in to change notification settings - Fork 8
Improve the process for importing Grafana dashboard examples #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mtlljm
wants to merge
1
commit into
main
Choose a base branch
from
pr-9141-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24
−15
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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). | ||
|
|
||
| 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**. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.