Skip to main content

Integrating External Data

Compatibility

  • External data: MySQL (currently supported)
  • Collector: 4.2.0.0 or later, with the Guanyun Collector module enabled

Integrating MySQL Data

Integration Steps Overview

  1. Confirming the integration target: Identify the MySQL environment details required for integration, including the MySQL instance IP, database name, and data table name.

  2. Determining the data collection location: Deploy Collector in the same network environment as the target MySQL host, and confirm the Collector IP used to collect data.

  3. Requesting database access permissions: Contact your operations team to create a read-only monitoring account on the target MySQL host with the following requirements:

    • Limit permissions to the target database and tables
    • Grant only SELECT
    • Allow access only from the Collector IP above
  4. Allowing network access: Contact your operations team to allow the firewall rule from Collector to MySQL (Collector IP → MySQL IP:port).

  5. Deploying or reusing Collector: Confirm whether a Collector is already available in the current environment, and reuse or deploy one as needed.

  6. Configuring the data source: In the Guanyun Platform Data Integration lite app, configure the MySQL data source connection.

  7. Generating database metrics: In the Guanyun Platform Metric System lite app, generate database metrics based on the integrated data source.

Step-by-Step Configuration

Step 1: Confirming the Integration Target

Before integration, please confirm the following information (used for database account authorization and platform configuration):

  • MySQL instance IP
  • Database name
  • Table name
  • Collector host IP (must be in the same network environment as MySQL)

Step 2: Preparing or Installing Collector

To pull MySQL data via Collector, ensure that Collector can reach the MySQL host over the network.

Option 1: Reusing an existing Collector (recommended)

If a Collector already exists in the current network environment, you can reuse it without reinstalling.

Confirm that the Guanyun Collector module is enabled:

  1. Check module status:

    grep 'guanyun_enabled' /opt/tingyun-collector/conf/collector.yaml
  2. If the output is guanyun_enabled: false, change it to:

    guanyun_enabled: true
  3. Restart the Collector:

    systemctl restart tingyun-collector

Option 2: Installing Collector (if no Collector is available)

  1. Log in to Guanyun Platform.

  2. In the left navigation bar, click All Apps, then click Deployment Status in the lite app list.

  3. On the deployment status page, click the Collectors Operation tab at the top of the page.

  4. Click Create in the upper right corner and configure the Collector parameters:

    • You must enable Guanyun Collector to ingest monitoring data from external data sources.

    collector-setup-4.0.png

  5. Copy the installation script and run it on the target host to complete the installation.

Step 3: Requesting Database Access Permissions

To follow the principle of least privilege, create a read-only account in MySQL and grant read-only permissions for data collection.

  • Creating a monitoring account

    Run the following command on the MySQL host (example only; update as needed):

    CREATE USER 'tingyun_monitor_user'@'Collector IP' IDENTIFIED BY 'your_password';

    Parameters:

    • tingyun_monitor_user: Read-only user name (customizable).
    • Collector IP: Replace with the actual Collector IP. Do not use % to avoid allowing arbitrary source hosts.
    • your_password: Replace with a strong password.
  • Granting read-only permissions

    Grant only SELECT on the target database/tables (example only; update as needed):

    GRANT SELECT ON example_db.static_day TO 'tingyun_monitor_user'@'Collector IP';
    GRANT SELECT ON example_db.static_hour TO 'tingyun_monitor_user'@'Collector IP';
    FLUSH PRIVILEGES;

Step 4: Configuring Network and Port Rules

Ensure that Collector can access the MySQL instance. Contact your operations team to allow the following access rules:

Source AddressTarget AddressTarget PortDescription
Collector HostGuanyun Platform80Installing Collector and uploading data to Guanyun Platform
Collector HostMySQL Host3306Pulling MySQL data

Step 5: Configuring the Data Source

  1. Log in to Guanyun Platform.

  2. In the left navigation bar, click All Apps, then click Data Integration in the lite app list.

  3. On the Data Integration page, click the Data Access tab and select Database under External Data.

  4. On the Database data access page, fill in the connection parameters and confirm the following before saving:

    3rd-mysql.png

    • Username/Password: The MySQL read-only monitoring account and password created in Step 3.
    • Collector: The Collector you confirmed in Step 2.

Step 6: Generating Database Metrics

  1. In the left navigation bar, click All Apps, then click Metric System in the lite app list.

  2. Click Generate. On the Add Custom Metric page, complete the following configuration:

    • Data source: Select the MySQL data source configured in Step 5.
    • SQL query: Configure the query statement used for data collection.
    • Metric settings: Set the metric name, unit, dimensions, and other parameters.

    metric-mysql.png

  3. Click OK.

Step 7: Viewing Data in Guanyun Platform

Go to the Data Explorer lite app, select METRIC as the data model, and query the metric name configured above.