Auto suggestions for prometheus ppl and promQL queries.
Prometheus Autocomplete Documentation
prometheus_autocomplete_logic.ts
getCatalogs - retrieves catalogs and saves into catalogsFromBackend and catalogListcatalogsFromBackend: list of CatalogItem, used to fill autocomplete suggestions
catalogList: list of String, used to check if catalog is included in query
getMetrics - gets metrics as a list of strings, gets all indices for currCatalogmetricsFromBackend: list of MetricItem, used to fill autocomplete suggestions
metricList: list of String, used to check if metric is included in query
getFields - gets fields as a list of strings
fieldsFromBackend: list of FieldItem, used to fill autocomplete suggestions
fieldList: list of String, used to check if field is included in query
getDataValues - gets data values as a list of strings
dataValuesFromBackend: list of dataItem
parseGetPromSuggestions - main function to get suggestions for prometheus autocomplete
Current Status
On the prometheus autocomplete branch on Eugene’s fork, autocomplete is implemented from
source → = → catalog → metric → | → command → field → = → data
There are two separate autocomplete logic files. The pre-existing autocomplete_logic.ts and the new prometheus_autocomplete_logic.ts. We pass the parseGetSuggestions function into the Autocomplete component or the Search component as a prop to decide what logic is used.
To Do
Replace DUMMY_API with real calls that fetches catalogs, metrics, and fields
Auto suggestions for prometheus ppl and promQL queries.
Prometheus Autocomplete Documentation
prometheus_autocomplete_logic.ts
getCatalogs - retrieves catalogs and saves into catalogsFromBackend and catalogList catalogsFromBackend: list of CatalogItem, used to fill autocomplete suggestions catalogList: list of String, used to check if catalog is included in query
getMetrics - gets metrics as a list of strings, gets all indices for currCatalog metricsFromBackend: list of MetricItem, used to fill autocomplete suggestions metricList: list of String, used to check if metric is included in query
getFields - gets fields as a list of strings fieldsFromBackend: list of FieldItem, used to fill autocomplete suggestions fieldList: list of String, used to check if field is included in query
getDataValues - gets data values as a list of strings dataValuesFromBackend: list of dataItem
parseGetPromSuggestions - main function to get suggestions for prometheus autocomplete
Current Status
On the prometheus autocomplete branch on Eugene’s fork, autocomplete is implemented from source → = → catalog → metric → | → command → field → = → data
There are two separate autocomplete logic files. The pre-existing autocomplete_logic.ts and the new prometheus_autocomplete_logic.ts. We pass the parseGetSuggestions function into the Autocomplete component or the Search component as a prop to decide what logic is used.
To Do