The general Idea is to display data results from a Prometheus query into a Monocle widget by having some part of a Monocle query that adapt the Prometheus query API call.
The need came from a discussion about how to Integrate Pelorus 1 metrics w/ the Monocle UI.
How this could work:
A list of PromQL queries are listed in a specific section of the Monocle configuration file. Each query provide metadata like: query-name, query-type (instant or range) 2.
A new Monocle query endpoint takes as input a Monocle Query and the name of the PromQL query then performs the request on the Prometheus API and returns either a structured JSON data (rendered by JS) or a ready to display graph (rendered server side) to the Monocle UI.
Some part of the Monocle query could be extracted to specialize the promQL query and the API call to the query or query_range endpoint. For instance:
from/to keywords should be extracted from the Monocle query to specify start/end prometheus parameters.
repo/author should be extracted and update the promQL query by adding a metadata selector such as failure_creation_timestamp{repo="todolist",issue_number="1"} where repo="todolist" is extracted from the Monocle query.
This story shares some idea about feasibility.
The general Idea is to display data results from a Prometheus query into a Monocle widget by having some part of a Monocle query that adapt the Prometheus query API call.
The need came from a discussion about how to Integrate Pelorus 1 metrics w/ the Monocle UI.
How this could work:
Some part of the Monocle query could be extracted to specialize the promQL query and the API call to the query or query_range endpoint. For instance:
failure_creation_timestamp{repo="todolist",issue_number="1"}
whererepo="todolist"
is extracted from the Monocle query.