Skip to main content

Data Source Management

"Data Sources" is the configuration center of the Ops Platform. All monitored hosts, middleware, and clusters are registered here. The available resource monitoring menus and alert rule types are dynamically determined by enabled data sources.

Data source management

Supported Types

TypeMultiple InstancesConnection Method
PrometheusBuilt-in singletonBuilt-in metrics database of the Ops Platform; read-only and cannot be disabled or deleted
HostHost address (port connectivity and related monitoring)
MySQLHost/port/username/password
MongoDBConnection URI, replica sets supported
RedisHost/port/password/DB
KafkaBroker addresses, SASL supported
ElasticsearchAddress + HTTP Basic authentication
FlinkSingleton entryFlink Web UI address. After enabled, the "Flink" entry appears in the left sidebar and is accessed through the Ops Platform reverse proxy

Collection Status

Each data source in the list includes "Collection Status", used to determine whether the data source is being collected. Most collection issues can be located from this status first:

StatusMeaningCommon Handling
CollectingNormal; metrics are being written
No DataCollector process is running, but no metrics have been obtainedUsually account/password/permission issues. Hover to view the original reason
StoppedCollector process is not runningHover to view the exit reason (unreachable address, wrong port, authentication failure, etc.); the process retries automatically
Not CollectedCollection has not been started for this data sourceCheck whether the purpose includes "Diagram" and whether the data source is enabled
UnknownStatus is temporarily unavailableConfirm that the ops-agent (middleware) or ops-prometheus (host) container has started

Hovering over a red status displays the original failure reason (for example, 401 unable to authenticate user or connection refused) and provides troubleshooting commands that can be copied directly. When dashboards have no data, check collection status first.

Host status comes from a different path

Host (node_exporter) is deployed on the monitored host and scraped directly by the Ops Platform Prometheus, without going through ops-agent. Therefore its collection status is derived from Prometheus scrape results and differs from other data source types:

  • A newly registered host may briefly show "Not Collected"; after about 30 seconds, the scrape target is delivered and the status changes to "Collecting".
  • If the address is configured but the peer is not node_exporter, or the port is unreachable, the status is "No Data".
  • If the Ops Platform Prometheus itself cannot be queried, the status is "Unknown". This means the status cannot currently be determined and does not necessarily mean collection failed.

The troubleshooting command shown on hover probes the host address (curl http://host:port/metrics); it is not an instruction to enter the agent container.

Where Configuration Takes Effect

Collection configuration uses this page as the only source. Creating data sources, changing passwords, enabling, and disabling are all done on this page. Changes take effect immediately without restarting containers.

Since 1.5.0, ops.yaml no longer participates in data source configuration. It only describes the Ops Platform's own dependencies, not monitoring targets.

To connect multiple instances at once, use "Batch Import" in the upper-right corner: download the YAML template, change the connection addresses to the current environment, and upload it. It is recommended to click "Validate Only" first, which performs format validation and per-entry connection probing without writing data. Import is idempotent by "type + name". The same file can be imported repeatedly. Leave passwords empty when updating existing entries to keep the original passwords.

Export Configuration (Backup/Migration)

"Export Configuration" in the upper-right corner exports all current data sources as YAML in the same format as batch import. The exported file can be restored through "Batch Import" for backup, reinstall recovery, or migration across environments.

Two options are available:

OptionPasswordWhen to Use
Export configuration (without passwords)EmptyDaily backups and import back to the same Ops Platform. Empty does not mean clearing passwords; during import, existing passwords in the Ops Platform are reused automatically by "type + name"
Export configuration (with plaintext passwords)PlaintextMigration to another Ops Platform, or recovery when the original Ops Platform database is unavailable. The file contains plaintext passwords; store it properly and never commit it to a code repository

The password-free option also removes embedded credentials from MongoDB URIs (mongodb://user:pass@hostmongodb://host). When restoring to another environment, fill in the credentials again. The file header comments also describe this behavior.

Purposes

Each data source can select one or more purposes, which determine the feature scope it participates in:

PurposeEffect
DiagramDisplays the instance dashboard in the corresponding "Resource Monitoring" menu
AlertAllows alert rules to be created for the instance
Slow Query DiagnosticsMongoDB only: enables slow query analysis and index diagnostics. ⚠️ The Ops Platform enables profiling on the target database when it detects profiling is not enabled (db.runCommand({profile:1, slowms:100}); the threshold is controlled by ENV_GATEWAY_PROFILE_SLOW_MS). This is the only write the Ops Platform performs on the monitored database. Indexes are not created automatically; users must click "Create" on the diagnostics page. Diagnostic history is written only to the Ops Platform's own ops-mongo

Account Permissions for Monitored Targets

Before registration, prepare accounts with the required permissions for each monitored target. The Ops Platform is read-only oriented by default:

TargetRequired Permissions
MySQLSELECT, SHOW DATABASES, PROCESS, REPLICATION CLIENT
MongoDBroot recommended; see the minimum-permission example below
RedisData read permission
KafkaIf authentication is enabled, permission to read cluster metadata
ElasticsearchRead/write index permissions
FlinkWeb address accessible from the Ops Platform internal network

Minimum MongoDB permissions (readWrite/dbAdmin are used for index creation during slow query diagnostics):

use admin
db.createUser({
user: "opsuser", pwd: "your_secure_password",
roles: [
{ role: "clusterMonitor", db: "admin" },
{ role: "readAnyDatabase", db: "admin" },
{ role: "clusterManager", db: "admin" },
{ role: "dbAdmin", db: "mdwsrows" }, { role: "readWrite", db: "mdwsrows" },
{ role: "dbAdmin", db: "mdservicedata" }, { role: "readWrite", db: "mdservicedata" },
{ role: "dbAdmin", db: "mdworksheet" }, { role: "readWrite", db: "mdworksheet" },
{ role: "dbAdmin", db: "mdworkflow" }, { role: "readWrite", db: "mdworkflow" }
]
})

Elasticsearch Account Fields

A common failure is connection succeeds but no metrics are collected, usually caused by an incorrect username. When "Test Connection" is clicked, the Ops Platform also checks the collection status and will directly report "Connection succeeded, but no data has been collected yet" for this case.

ItemValue
URLhttp://<ES-address>:9200, including the protocol
Usernamemd — the built-in ES username in private deployment is md, not elastic
PasswordES password set during HAP/HDP deployment

To determine whether data has been collected, check whether the "Collection Status" column is Collecting, or click "Test Connection" directly. If "No Data" is displayed, hover to view the reason. Credential errors directly indicate that the account or password is incorrect.

Operations

  • Create: Click "New Data Source" in the upper-right corner → select type → enter connection information.
  • Test Connection: Uses real credentials for authentication checks (MongoDB ping, MySQL login, Kafka metadata fetch, Redis AUTH, ES authentication request), not only port connectivity. It also verifies collection status. Connectivity success does not mean dashboards already have data; target delivery, collector process, and metrics scraping status must also be confirmed. The result clearly shows "Connection succeeded, collecting" or "Connection succeeded, but no data has been collected yet" and provides the reason.
  • Connectivity Check: The upper-right button runs the above checks in batch for all data sources in the list. The "Status" column shows Connected·Collecting/No Data/Degraded/Unreachable.
  • Enable/Disable: Toggle the list switch. After disabling, the corresponding resource monitoring menu and alert types are automatically hidden, and existing alert rules stop scheduling.
  • Edit: Stored passwords are shown as masks. Leave blank to keep unchanged.
Credential Security

Passwords and connection URIs are encrypted with ENV_ALERT_CRYPTO_KEY before being written to the database, and APIs return masks uniformly. Set this key during first deployment and keep it safe. Changing the key prevents saved credentials from being decrypted and requires re-entry.

After Registration

After data sources are registered and collection status is normal: