|
| 1 | +--- |
| 2 | +title: "Data source management" |
| 3 | +description: "Configure and manage data sources for Monitors, including Prometheus, Elasticsearch, Loki, ClickHouse, MySQL, Oracle, PostgreSQL, and SLS" |
| 4 | +keywords: ["data source", "Prometheus", "Elasticsearch", "Loki", "ClickHouse", "MySQL", "Oracle", "PostgreSQL", "SLS"] |
| 5 | +--- |
| 6 | + |
| 7 | +Data sources are where the alert engine queries data. You need to configure data sources first so the alert engine can read data from them for anomaly detection. |
| 8 | + |
| 9 | +**Menu Entry**: Data Sources |
| 10 | + |
| 11 | +## Supported data source types |
| 12 | + |
| 13 | +Monitors supports the following 8 data source types: |
| 14 | + |
| 15 | +| Type | Description | |
| 16 | +|------|-------------| |
| 17 | +| **Prometheus** | Time series database, queried via PromQL | |
| 18 | +| **Elasticsearch** | Distributed search and analytics engine | |
| 19 | +| **Loki** | Lightweight log aggregation system | |
| 20 | +| **ClickHouse** | Columnar analytics database | |
| 21 | +| **MySQL** | Relational database | |
| 22 | +| **Oracle** | Relational database | |
| 23 | +| **PostgreSQL** | Relational database | |
| 24 | +| **SLS** | Alibaba Cloud Log Service | |
| 25 | + |
| 26 | +## Data source list |
| 27 | + |
| 28 | +The data source list displays all configured data sources with the following information: |
| 29 | + |
| 30 | +- **Name**: The identifier for the data source |
| 31 | +- **Type**: Data source type with icon |
| 32 | +- **Connection URL**: The access address of the data source |
| 33 | +- **Associated Alert Engine**: The bound alert engine cluster name, with engine online status indicator |
| 34 | +- **Notes**: Supplementary description |
| 35 | + |
| 36 | +You can filter data sources by name or type using the search box. The list auto-refreshes every 5 seconds to reflect real-time engine connection status. |
| 37 | + |
| 38 | +## Create a data source |
| 39 | + |
| 40 | +<Steps> |
| 41 | +<Step title="Select data source type"> |
| 42 | +Click the **New** button and select the data source type (e.g., Prometheus, MySQL) at the top of the form. |
| 43 | +</Step> |
| 44 | +<Step title="Fill in basic information"> |
| 45 | + |
| 46 | +| Config Item | Description | |
| 47 | +|-------------|-------------| |
| 48 | +| **Name** | Unique identifier for the data source; alert rules reference data sources by name (wildcards supported) | |
| 49 | +| **Notes** | Optional supplementary description | |
| 50 | +| **Associated Alert Engine** | Select the engine cluster responsible for querying this data source; typically choose a cluster in the same datacenter | |
| 51 | + |
| 52 | +</Step> |
| 53 | +<Step title="Configure connection parameters"> |
| 54 | +Fill in the connection parameters specific to the data source type. See the sections below for details. |
| 55 | +</Step> |
| 56 | +<Step title="Save"> |
| 57 | +Click **OK** to complete creation. |
| 58 | +</Step> |
| 59 | +</Steps> |
| 60 | + |
| 61 | +<Warning> |
| 62 | +Data source names are used for association in alert rules (wildcard matching supported). Changing a data source name may cause existing alert rules to stop working. Please proceed with caution. |
| 63 | +</Warning> |
| 64 | + |
| 65 | +## Data source type configuration |
| 66 | + |
| 67 | +### Prometheus |
| 68 | + |
| 69 | +| Config Item | Description | |
| 70 | +|-------------|-------------| |
| 71 | +| **Server URL** | Prometheus server address, e.g., `http://localhost:9090` | |
| 72 | +| **Headers** | Custom HTTP request headers, supports multiple Key-Value pairs | |
| 73 | +| **Params** | Custom URL query parameters, supports multiple Key-Value pairs | |
| 74 | +| **Basic Authentication** | When enabled, requires username and password | |
| 75 | +| **Self-Signed Certificate** | When enabled, fill in CA certificate content | |
| 76 | +| **TLS Client Authentication** | When enabled, requires ServerName, client certificate, and client key | |
| 77 | +| **Skip TLS Certificate Validation** | Skip TLS certificate verification | |
| 78 | + |
| 79 | +### MySQL / Oracle / PostgreSQL |
| 80 | + |
| 81 | +Relational databases share a similar configuration structure: |
| 82 | + |
| 83 | +| Config Item | Description | Default | |
| 84 | +|-------------|-------------|---------| |
| 85 | +| **Connection URL** | Database address, e.g., `localhost:3306` (MySQL), `localhost:1521` (Oracle), `localhost:5432` (PostgreSQL) | - | |
| 86 | +| **Max Connections** | Maximum open connections in the connection pool | 32 | |
| 87 | +| **Idle Connections** | Maximum idle connections in the connection pool | 4 | |
| 88 | +| **Connection Lifetime (seconds)** | Maximum connection lifetime | 600 | |
| 89 | +| **Timeout (milliseconds)** | Query timeout | 5000 | |
| 90 | +| **Username** | Database username | - | |
| 91 | +| **Password** | Database password | - | |
| 92 | + |
| 93 | +Self-signed certificate and TLS client authentication configurations are also supported. |
| 94 | + |
| 95 | +### Elasticsearch / Loki / ClickHouse / SLS |
| 96 | + |
| 97 | +These data sources have connection configurations similar to Prometheus, including server address, authentication, and TLS settings. Refer to the creation form for specific parameters. |
| 98 | + |
| 99 | +## Test a data source |
| 100 | + |
| 101 | +In the data source list, click the **Test** button for the corresponding data source to open a query preview window, verify the connection, and preview query results. |
| 102 | + |
| 103 | +## Edit and delete |
| 104 | + |
| 105 | +- **Edit**: Click the **Edit** button in the data source list to modify the configuration and save. |
| 106 | +- **Delete**: Click the **Delete** button in the data source list and confirm to delete the data source. |
| 107 | + |
| 108 | +<Warning> |
| 109 | +Before deleting a data source, ensure no alert rules reference it, otherwise the related alert rules will not execute properly. |
| 110 | +</Warning> |
0 commit comments