opensearch-project / observability

Visualize and explore your logs, traces and metrics data in OpenSearch Dashboards
https://opensearch.org/docs/latest/observability-plugin/index/
Apache License 2.0
52 stars 98 forks source link

[Event]Auto suggestion for prometheus ppl and promQL queries. #884

Open vamsi-amazon opened 2 years ago

vamsi-amazon commented 2 years ago

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

eugenesk24 commented 2 years ago