×
Community Blog Introduction on Alibaba Cloud Managed Service for Grafana

Introduction on Alibaba Cloud Managed Service for Grafana

This article introduces Managed Service for Grafana and its features, capabilities and basic usages.

1. About Grafana

Grafana is an open-source data visualization tool that simplifies the process of creating data charts for monitoring and statistics. When using Grafana, it needs to be combined with data collection tools like Managed Service for Prometheus (Prometheus) and Elasticsearch. Grafana supports various data sources such as Elasticsearch, MySQL, Prometheus, Zabbix, InfluxDB, PostgreSQL, Graphite, and OpenTSDB.

2. About Managed Service for Grafana

Managed Service for Grafana is a cloud-native visualization platform for data operations. It provides users with an O&M-free environment to run Grafana, allowing for quick deployment. By default, it integrates data sources from various Alibaba Cloud services such as database services, Message Queue services, Prometheus, and Simple Log Service. It also offers rich data dashboards for more detailed O&M and monitoring.

Managed Service for Grafana efficiently analyzes and displays metrics, logs, and traces without the need for server configuration or software updates, reducing maintenance complexity and workload. Additionally, it leverages the powerful cloud-native capabilities of Alibaba Cloud to enhance the overall security and availability of Grafana.

Managed Service for Grafana supports various Alibaba Cloud data sources, including Application Real-Time Monitoring Service (ARMS), Prometheus, and Simple Log Service. It allows users to deploy on-premises data sources on large disks or use self-managed data sources like Elasticsearch clusters and InfluxDB databases in a Virtual Private Cloud (VPC). Managed Service for Grafana seamlessly integrates with the open-source Grafana.

3. Features and Capabilities

3.1. Features of Managed Service for Grafana

1

3.2. Capabilities of Managed Service for Grafana

Integrate with cloud services by default

By default, Managed Service for Grafana integrates with Alibaba Cloud services such as ARMS, Prometheus, CloudMonitor, Simple Log Service, and Elasticsearch. It provides data source settings for each cloud service, pre-configurations for large disks, and the one-click alerting feature.

Various plug-ins to choose from

Managed Service for Grafana can be connected to your tools by using Grafana plug-ins. The data source plug-in can connect to an existing data source by calling an API operation and display data in real time without the user manually retrieving or migrating the data.

Customized alert system

You can create, manage, and mute all Grafana alerts in one simple UI. All alerts can be easily integrated and centrally managed.

Multi-dimensional data query

Cross-data source query, and the renaming, aggregating, joining, and computing of data sources are supported.

Build your own data source

Managed Service for Grafana allows you to bridge multiple VPCs in the same region, add data sources in multiple VPCs to the same workspace and display queries and alerts in a unified manner.

Panel editor

With a consistent UI for configuring data options in all visual panels, you can easily configure, customize, and navigate all panels.

4. Use Cases

Managed Service for Grafana supports one-click integration and synchronization of data sources from Alibaba Cloud services and their corresponding dashboards. You can conveniently check and manage cloud service integration on the workspace's information page. In this section, we will explore the integration of Simple Log Service, MySQL, and Grafana services.

4.1. Create Grafana

Create a Grafana workspace.

2
3

Click Create Workspace to go to the Create Workspace page.

4

5
6
7

A workspace instance of Grafana has been created.

Grant the Grafana-related permissions to your account.

8
9
10

Log on to Grafana.

11

(1) Click the following URL to go to the Grafana logon page.

https://grafana-intl-sg-uq837d56f0m.grafana.aliyuncs.com:443

12

(2) Log on to Grafana by using your Alibaba Cloud account.

13
14

4.2. Connect Grafana to Simple Log Service

The Grafana service for ARMS has the data source plug-in of Simple Log Service installed by default. This plug-in allows you to synchronize data from Simple Log Service and display data in real time in the Grafana dashboard. You do not need to manually retrieve or migrate data.

4.2.1. Create a project for Simple Log Service

15
16

4.2.2. Prepare a data source for Simple Log Service

(1) Forward ActionTrail logs to Simple Log Service.

Create a trail in ActionTrail

17
18
19

(2) Check the ActionTrail logs in Simple Log Service.

20

4.2.3. Add a Simple Log Service data source to Grafana

(1) Obtain the endpoint of a Logstore in advance.

Endpoint: ap-northeast-1.log.aliyuncs.com

21

(2) Click the access URL from the Grafana instance details page to log on to Grafana.

22

Click the following URL to go to the Grafana logon page.

https://grafana-intl-sg-uq837d56f0m.grafana.aliyuncs.com:443

(3) Go to the Data Sources page to add a data source by clicking the configuration icon on the Grafana homepage.

23

(4) Add the log-service-datasource data source.

24

(5) Configure the data source.

25

(6) After configuring the data source, save and test the data source.

26

4.2.4. Check the log data in Grafana

(1) From the Explore menu, go to the Explore page of the Simple Log Service data source.

27

(2) Click Run query


* | select count(*) as c, __time__-__time__%60 as t group by t

28
29

View data in bar graph.

30

Check the Stacked line graph.

31

4.3. Connect Grafana to MySQL database

4.3.1. Prepare a MySQL data source

Create a VPC.

32
33

Create an ApsaraDB RDS for MySQL instance.

34
35

Prepare MySQL data.

(1) Create an account.

36

(2) Create a database.

37

(3) Check the whitelist.

38

(4) Log on to the ApsaraDB RDS for MySQL instance.

39

(5) Create a table.

CREATE TABLE `table_grafana` (
  `id` int(11) NOT NULL,
  `place` varchar(32) DEFAULT NULL,
  `user` varchar(32) DEFAULT NULL,
  `operate` varchar(32) DEFAULT NULL,
  `operate_time` varchar(32) DEFAULT NULL,
   `count` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

40

(6) Prepare CSV data.

41

(7) Import data from CSV file.

42
43

Click Execute Change.

44

(8) Check the data.

45

4.3.2. Add the MySQL data source to Grafana

Log on to the access URL of the Grafana instance.

46
47

Add the MySQL data source.

Host: rm-0iw17ivyte8s70gft8o.mysql.japan.rds.aliyuncs.com:3306
Data source: SBDB
User: sbtest

48
49
50

4.3.3. Use graphs to display MySQL data in Grafana

Create a dashboard.

51

(1) Create a panel for the table.


SELECT
  id AS "Numbers",
  place AS "Cities",
  user AS "Users",
  operate AS "Actions",
  count AS "Counts",
  operate_time AS "Operation Time"
FROM table_grafana

52

Click Apply.

53

(2) Create a chronological panel.

Data Source: MySQL
Panel: TimeSeries
Style: Bars
Opacity: 100

54

Click Edit SQL.

Run the following SQL query:

SELECT
  UNIX_TIMESTAMP(operate_time) DIV 3600 * 3600 AS "time",
  user AS metric,
  avg(count) AS "count"
FROM table_grafana
WHERE
  operate_time BETWEEN FROM_UNIXTIME(1681920000) AND FROM_UNIXTIME(    1681934400)
GROUP BY 1,2
ORDER BY UNIX_TIMESTAMP(operate_time) DIV 3600 * 3600

55
56

Click Apply.

57

Click Zoom to data to display the graph.

58

Save the dashboard.

59

The dashboard has been saved.

60

5. Conclusion

Managed Service for Grafana is a cloud-native data visualization platformthat caters to the needs of data querying, data visualization, and setting alerts in various scenarios such as O&M monitoring, operational analysis, and report display. It supports a wide range of data sources. In concludion, we have introduced the basic use of the Managed Service for Grafana service.

This article is a translated piece of work from SoftBank:
https://www.softbank.jp/biz/blog/cloud-technology/articles/202309/alibaba-grafana/
https://www.softbank.jp/biz/blog/cloud-technology/articles/202309/alibaba-grafana2/

Disclaimer: The views expressed herein are for reference only and don't necessarily represent the official views of Alibaba Cloud.

0 1 0
Share on

H Ohara

12 posts | 0 followers

You may also like

Comments

H Ohara

12 posts | 0 followers

Related Products