The meshIQ platform supports an integration using a data source for Grafana. That data source will issue queries for various data sources within the meshIQ platform. This includes analytic and tracking data, expert metrics, and administrative data.
In support of this initiative, a REST endpoint is now available as an M6 expert, which will provide the data. The query language used, jKQL, is the same as can be used within the XRay interface when used with or without Grafana.
You can pause notifications temporarily or at scheduled times using Silences and Mute timings.
Step 1: Create a meshIQ data source
In Grafana, you set up data sources for each application you want to connect to. The data source setup allows you to obtain data from that application.
To set up a data source for meshIQ, do the following:
- Open the menu on the left side of the Grafana window and click the Connections button .
- The Add new connection page opens. The potential data sources you can create are listed.
- Search for meshIQ and select it.
- Enter a Name for the Data source.
- Turn on the Default toggle to make this the default Data source.
- Fill in the required fields:
Service URL: Data for the meshIQ-Grafana integration is provided by a REST endpoint that is available as an expert. The Service URL is the address where the DSX expert is running.
- Access Token:
- Service URL: Data for the meshIQ-Grafana integration is provided by a REST endpoint that is available as an expert. The Service URL is the address where the DSX expert is running.
- Click Save & test to confirm that the DSX expert service is working.
- (Optional) The Autocomplete service is recommended to help you complete jKQL queries by offering suggestions as you type. To turn on Autocomplete, click the Enable Auto-complete toggle. Add the Autocomplete Service URL:
- Click Save & test to confirm that the Autocomplete service is working. A confirmation message is displayed:
- Once the connection is successfully tested, you can expand Advanced Settings and view the Max data points limit. The Max data points limit is the number of rows that the server can return on the back end. This limit comes from the CEP server configuration. The default value is 10000. Changes to it would need to be made in the DSX configuration.
Step 2: Create a dashboard
- When writing a query, use the up and down arrow keys to select a field. Press Tab on your keyboard to make a selection.
- If you haven't started typing yet, or if you have closed Autocomplete, you can turn autosuggestions back on. Either starting typing again, or press Ctrl + spacebar.
- To run query, press Ctrl+ Enter. (Do not press only Enter.)
- Turn on Table view at any time to view your results as a table .
How to create a dashboard
Now that the Data Source has been created, you can create a new dashboard.
Open the menu on the left side of the Grafana window.
- Click the Dashboards option. The Dashboards page opens.
- Select New > New Dashboard.
The Start your new dashboard… page opens. You are prompted to add a visualization.
Add a visualization
Add a new visualization:
- Click + Add visualization. The Select data source page opens.
Select the meshIQ data source. In the lower left panel, the meshIQ data source is selected.
- Note the Query options that are in effect for the query. Among these Query options is Max data points, a Grafana setting. The Max data points value represents Grafana's determination of how much data it can display, based on the "width of the panel." The Max data points limit under Advanced Settings is prefilled based on the configuration settings for the data source. When you run a jKQL query, the number of data points returned is the lesser of the two values (Max data points limit or Max data points).
- Begin typing a query (such as a GET query). Autocomplete offers suggestions. See the following sections:
- Use the examples below to create a query.
- Run the query by pressing Control + Enter on your keyboard.
Data is missing a number field
If your data is missing a number field, you are prompted to view it as a table or open visualization suggestions.
Click Switch to table. (You can also turn on Table view at any time to view your results as a table .)
The data is displayed as a table:
Autocomplete "contains" match
As you type a query, Autocomplete will offer suggestions. These suggestions include all partial matches, including "contains" matches.
get WgsEmsQueue FIELDS
Add 'FIELDS' to your query and Autocomplete provides a list of fields in the table you specify.
Use the up and down arrow keyboard keys to select a field. To add the selected field to your query, press Tab on your keyboard.
View Properties with FIELDS ALL
By default, properties are not included. If you want to see all the properties, run a query with "FIELDS ALL".
Get WgsEmsQueue FIELDS ALL
Adjust the parameters
You can make changes to the Advanced Settings to adjust results after they are returned.
In the example below, the Max Data Points Limit is 5.
You can change the Max Data Points Limit to 2, return to the jKQL prompt, and press Enter on your keyboard. The table results are updated.
Save the dashboard
- The Save dashboard area opens. Enter a Dashboard name and select a Folder.
- Click Save. After the dashboard is saved, its panel is displayed:
To resize the panel, place your mouse in the lower right corner until it changes to an nw-resize cursor: . Click and drag up and left to make the panel smaller, or down and right to make it larger.
Use the vertical ellipses at the top right of the panel to open a menu with panel options such as edit, share, explore, inspect, or remove.
Step 3: Set up alerts
See Alert Rules.
Step 4: Create contact points
Contact points consist of an integration method for sending notifications and a list of notification recipients. Integration options include Discord, Email, Slack, and others. In this example we will use email.
For Email integrations, Grafana comes with a default contact point called grafana-default-email. When this email address is set up, it is used as the default when no other contact point has been specified.
- To create an Email contact point:
Select the Grafana menu , expand the Alerting section and select Contact points.
- Enter a Name and select Email from the Integration list. To add multiple email addresses, separate them with semicolons.
- To send one email to all recipients instead of a separate email to each one, select Single email. In this case, all recipients will be able to see the other recipients.
For more information about template variables, refer to the Grafana documentation at https://grafana.com/docs/grafana/latest/dashboards/variables/#templates.
- By default, contact points receive a resolved (OK) message for a resolved alert that they have previously received notifications for. If you do not want to send the resolved message, select Disable resolved message.
Step 5: Add a notification policy
A notification policy manages notifications by tying alert rules to contact points according to matching labels. For example, if a contact point has the value 'Devs' for the label 'teams' and an alert rule also has the value 'Devs' for the label 'teams' then the alert rule will use the notification policy.
- Select the Grafana menu , expand the Alerting section and select Notification policies.
- Click New nested policy.
- Use the Matching labels section to narrow down the alert rules that you want to be subject to this notification policy. Alert rules with labels that match this policy will become subject to it.
- Select the Contact point that you want to receive notifications according to this policy. See Create Contact points.
- Click Save policy.
When the alert rule conditions are met for the specified length of time, an email notification like the one below is sent to matching contact points.