[v10.0.x] docs: add datasource selector content (#69587)
docs: add datasource selector content (#69280)
* updated create dashboard topic including adding screenshot of DS selector
* finished editing build dashboards - create dashboards
* finished data source selection edits'
:
* updated tutorials
* reverted tutorial to old nav to match reality and added that prom DS is preselected
* wording edits
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* add that configure DS is only for admins
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit 865636993f)
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9b05220e4e
commit
6148dfc3d9
@@ -117,7 +117,7 @@ The sample application exposes metrics which are stored in [Prometheus](https://
|
||||
|
||||
To be able to visualize the metrics from Prometheus, you first need to add it as a data source in Grafana.
|
||||
|
||||
1. In the sidebar, hover your cursor over the **Configuration** (gear) icon, and then click **Data sources**.
|
||||
1. In the sidebar, hover over the **Configuration** (gear) icon, and then click **Data sources**.
|
||||
1. Click **Add data source**.
|
||||
1. In the list of data sources, click **Prometheus**.
|
||||
1. In the URL box, enter **http\://prometheus:9090**.
|
||||
@@ -131,7 +131,7 @@ Grafana Explore is a workflow for troubleshooting and data exploration. In this
|
||||
|
||||
> Ad-hoc queries are queries that are made interactively, with the purpose of exploring data. An ad-hoc query is commonly followed by another, more specific query.
|
||||
|
||||
1. In the sidebar, click the **Explore** (compass) icon.
|
||||
1. In the sidebar, click the **Explore** (compass) icon. The Prometheus data source that you added will already be selected.
|
||||
1. In the **Query editor**, where it says _Enter a PromQL query…_, enter `tns_request_duration_seconds_count` and then press Shift + Enter.
|
||||
A graph appears.
|
||||
1. In the top right corner, click the dropdown arrow on the **Run Query** button, and then select **5s**. Grafana runs your query and updates the graph every 5 seconds.
|
||||
@@ -166,7 +166,7 @@ Depending on your use case, you might want to group on other labels. Try groupin
|
||||
|
||||
Grafana supports log data sources, like [Loki](/oss/loki/). Just like for metrics, you first need to add your data source to Grafana.
|
||||
|
||||
1. In the sidebar, hover your cursor over the **Configuration** (gear) icon, and then click **Data Sources**.
|
||||
1. In the sidebar, hover over the **Configuration** (gear) icon, and then click **Data Sources**.
|
||||
1. Click **Add data source**.
|
||||
1. In the list of data sources, click **Loki**.
|
||||
1. In the URL box, enter [http://loki:3100](http://loki:3100).
|
||||
@@ -215,9 +215,8 @@ Dashboards consist of _panels_, each representing a part of the story you want y
|
||||
|
||||
Every panel consists of a _query_ and a _visualization_. The query defines _what_ data you want to display, whereas the visualization defines _how_ the data is displayed.
|
||||
|
||||
1. Click **Dashboard** in the left-side menu.
|
||||
1. On the Dashboards page, click **New** and select **New Dashboard** in the dropdown.
|
||||
1. Click **+ Add visualization**.
|
||||
1. In the sidebar, hover over the **Create** (plus sign) icon and then click **Dashboard**.
|
||||
1. Click **Add new panel**. The Prometheus data source that you added will already be selected.
|
||||
1. In the **Query** tab below the graph, enter the query from earlier and then press Shift + Enter:
|
||||
|
||||
```
|
||||
@@ -300,7 +299,7 @@ Your request bin is now waiting for the first request.
|
||||
|
||||
Next, let's configure a Contact Point in Grafana's Alerting UI to send notifications to our Request Bin.
|
||||
|
||||
1. Return to Grafana. In Grafana's sidebar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
|
||||
1. Return to Grafana. In Grafana's sidebar, hover over the **Alerting** (bell) icon and then click **Contact points**.
|
||||
1. Click **+ New contact point**.
|
||||
1. In **Name**, write **RequestBin**.
|
||||
1. In **Contact point type**, choose **Webhook**.
|
||||
@@ -315,7 +314,7 @@ We have now created a dummy webhook endpoint and created a new Alerting Contact
|
||||
|
||||
Now that Grafana knows how to notify us, it's time to set up an alert rule:
|
||||
|
||||
1. In Grafana's sidebar, hover the cursor over the **Alerting** (bell) icon and then click **Alert rules**.
|
||||
1. In Grafana's sidebar, hover over the **Alerting** (bell) icon and then click **Alert rules**.
|
||||
1. Click **+ New alert rule**.
|
||||
1. For **Section 1**, name the rule `fundamentals-test`, and set **Rule type** to **Grafana Managed Alert**. For **Folder** type `fundamentals` and in the box that appears, press **Create: fundamentals**.
|
||||
1. For **Section 2**, find the **query A** box. Choose your Prometheus datasource and enter the same query that we used in our earlier panel: `sum(rate(tns_request_duration_seconds_count[5m])) by(route)`. Press **Run queries**. You should see some data in the graph.
|
||||
@@ -323,7 +322,7 @@ Now that Grafana knows how to notify us, it's time to set up an alert rule:
|
||||
1. In **Section 3**, enter `30s` for the **Evaluate every** field. For the purposes of this tutorial, the evaluation interval is intentionally short. This makes it easier to test. In the **for** field, enter `0m`. This setting makes Grafana wait until an alert has fired for a given time before Grafana sends the notification.
|
||||
1. In **Section 4**, you can add some sample text to your summary message. [Read more about message templating here](/docs/grafana/latest/alerting/unified-alerting/message-templating/).
|
||||
1. Click **Save and exit** at the top of the page.
|
||||
1. In Grafana's sidebar, hover the cursor over the **Alerting** (bell) icon and then click **Notification policies**.
|
||||
1. In Grafana's sidebar, hover over the **Alerting** (bell) icon and then click **Notification policies**.
|
||||
1. Under **Default policy**, select **...** › **Edit** and change the **Default contact point** to **RequestBin**.
|
||||
As a system grows, admins can use the **Notification policies** setting to organize and match alert rules to
|
||||
specific contact points.
|
||||
|
||||
@@ -29,9 +29,9 @@ In this tutorial, you'll:
|
||||
|
||||
## Run Grafana and create admin token
|
||||
|
||||
1. Run Grafana following [installation instructions](/docs/grafana/latest/installation/) for your operating system
|
||||
1. Log in and go to Configuration -> API Keys
|
||||
1. Press "Add API key" button and create a new API token with **Admin** role
|
||||
1. Run Grafana following [installation instructions](/docs/grafana/latest/installation/) for your operating system.
|
||||
1. Log in and go to Configuration -> API Keys.
|
||||
1. Press "Add API key" button and create a new API token with **Admin** role.
|
||||
|
||||
## Configure and run Telegraf
|
||||
|
||||
@@ -65,12 +65,13 @@ The only thing left here is to create a dashboard with streaming data.
|
||||
|
||||
## Create dashboard with streaming data
|
||||
|
||||
1. Create new dashboard
|
||||
1. Press Add empty panel
|
||||
1. Select `-- Grafana --` datasource
|
||||
1. Select `Live Measurements` query type
|
||||
1. Find and select `stream/custom_stream_id/cpu` measurement for Channel field
|
||||
1. Save dashboard changes
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **New** and select **New Dashboard**.
|
||||
1. On the empty dashboard, click **+ Add visualization**.
|
||||
1. In the modal that opens, select the `-- Grafana --` data source.
|
||||
1. Select `Live Measurements` query type.
|
||||
1. Find and select `stream/custom_stream_id/cpu` measurement for Channel field.
|
||||
1. Save dashboard changes.
|
||||
|
||||
After making these steps Grafana UI should subscribe to the channel `stream/custom_stream_id/cpu` and you should see CPU data updates coming from Telegraf in near real-time.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user