Metric Sources API
The Metric Sources API allows you to manage connections to external systems that Lumetry polls for metrics, such as Prometheus, CloudWatch, or custom SQL databases.
List Metric Sources
GET /api/metric-sources
Returns a list of metric sources. Supports filtering by sourceType, enabled, and search text.
Get Metric Source
GET /api/metric-sources/{id}
Returns the configuration of a specific metric source.
Create Metric Source
POST /api/metric-sources
Creates a new metric source.
Update Metric Source
PUT /api/metric-sources/{id}
Updates an existing metric source configuration.
Delete Metric Source
DELETE /api/metric-sources/{id}
Deletes a metric source. Fails if the source is referenced by any metric definitions.
Test Connection
POST /api/metric-sources/{id}/test-connection
Enqueues a test connection job for the specified metric source and returns an accepted response with a testId to poll for results.
Test Query
POST /api/metric-sources/{id}/test-query
Enqueues a test query execution for the specified metric source and returns a testId to poll for results.
Get Test Result
GET /api/metric-sources/tests/{testId}
Retrieves the result of a previously enqueued test connection or test query job.
Assign Poller
PUT /api/metric-sources/{id}/poller
Assigns a specific Collector (Poller) to be responsible for scraping this metric source.
Set Credential
PUT /api/metric-sources/{id}/credential
Updates or sets the credential (e.g. API token, password) used to authenticate with the metric source.