Ensuring your datasources are consistently available and performing optimally is key to maintaining a healthy TrendMiner environment. Fortunately, the Connector API provides several endpoints that can help automate health monitoring for your datasources. Below, we explain how you can leverage these API calls to detect connection issues and performance degradation — even with a simple script.
Accessing connector API:
https://documentation.trendminer.com/en/using-the-connector-api.html
Checking if Datasources Are Available
To determine if a datasource is down (showing red status in the UI), use the following two-step process:
-
Retrieve all datasource IDs
Call:GET /database
This returns a list of configured datasources with their IDs. -
Test each datasource connection
For each ID from step 1, call:GET /database/{id}/test
This will return whether the datasource is currently healthy or not (basic connectivity check).
You can automate this process with a script that runs these calls regularly and alerts you if any datasource is down.
Monitoring Datasource Performance Metrics
In addition to basic connectivity, the Connector API also offers performance-related metrics that provide deeper insight into datasource health:
- Retrieve all datasource IDs
Call:GET /database
This returns a list of configured datasources with their IDs.
-
Call to retrieve metrics
GET /database/{id}/metrics
-
Example JSON response:
{
"DatabaseIndex50pInMillis": 5,
"DatabaseIndex95pInMillis": 7,
"DatabasePlot50pInMillis": null,
"DatabasePlot95pInMillis": null,
"DatabaseSync50pInMillis": 316,
"DatabaseSync95pInMillis": 357
}
These values show the latency (in milliseconds) for different types of operations:
-
Indexing
-
Plotting
-
Synchronization
These metrics measure the time from the connector to the datasource, not the full path to TrendMiner.