Creating Simple Graph/Table for XCALLY agent in Grafana

A few posts ago, we have shown how to create a dashboard in Grafana.

(GrafanaでXCALLYのダッシュボードを作ってみた)

And today we will demonstrate how to create simple table and graph calculating the “Break Time” of an XCALLY agent by using SQL.

For anyone who is interested to know more about Grafana, please check out Grafana’s homepage.

 

Create table

Choose Visualizlation

First of all, we will start by selecting “Choose Visualization”. It is also fine to start from “Add Query” since the visualization can be changed anytime. It really depends on personal preference.

 

Edit SQL

Now we are in text edit mode and can start editing the SQL, or switch to query builder as you like. Make sure “Format as” is set to Table instead of “Time series” so it doesn’t show any error.

 

Here is an example of SQL for the table:

 

Note

Please remember in order to have the table display data corresponding to the time range selected, timeFilter needs to be added in the SQL, such as $__timeFilter(updatedAt); otherwise, the time filter on Grafana will not work.

Now make a few adjusts so our table will look better. If you have a time column, make sure the column header is the same as the column alias.

 

Voila! Now we have created a simple Grafana table.

 

Create Graph

Design your SQL

Next, we will create a graph to show Break Time of XCALLY agent. Here is the SQL example.

 

And the result looks like this:

 

Note

When creating table or graph, please keep a few things in mind:

  • Add time filter in query for the time range to work properly.
  • The mode of x-axis can affect the outcome of the graph, so make sure to pick the right one. As following:

 

 

この記事が気に入ったら
いいね ! しよう

Twitter で
The following two tabs change content below.
アバター
Lillian Wu
エンジニアです。いろいろ勉強中です。

【採用情報】一緒に働く仲間を募集しています

採用情報
ページトップへ