mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Run exemplars explore queries through backend (#39531)
* Prometheus: Run Explore both queries trough backend * Refactor, simplify * Set default values for query type selector * Run multiple queries as one query trough backend * Remove trailing newlines * Pass utcOffset * Remove trailing comma * WIP: Implementatioon of exemplars * add sampling for exemplars * Refactor to use response as custom metadata * Simplify processing of exemplars * Update, clean up * Refactor the way how we get available exemplars * Simplify exemplars disabling and running on frontend * Add tests * Update toggle * Remove console log * Fix go linting * Fix e2e test * Trigger Build * Compare lengts, small fix * Remove duplicated time check * Address feedback * Remove redundant ! as not needed * Update
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
addLimitInfo,
|
||||
fixSummariesMetadata,
|
||||
parseSelector,
|
||||
processHistogramLabels,
|
||||
processHistogramMetrics,
|
||||
processLabels,
|
||||
roundSecToMin,
|
||||
} from './language_utils';
|
||||
@@ -123,8 +123,7 @@ export default class PromQlLanguageProvider extends LanguageProvider {
|
||||
await this.fetchLabels();
|
||||
this.metrics = (await this.fetchLabelValues('__name__')) || [];
|
||||
this.metricsMetadata = fixSummariesMetadata(await this.request('/api/v1/metadata', {}));
|
||||
this.processHistogramMetrics(this.metrics);
|
||||
|
||||
this.histogramMetrics = processHistogramMetrics(this.metrics).sort();
|
||||
return [];
|
||||
};
|
||||
|
||||
@@ -132,14 +131,6 @@ export default class PromQlLanguageProvider extends LanguageProvider {
|
||||
return this.labelKeys;
|
||||
}
|
||||
|
||||
processHistogramMetrics = (data: string[]) => {
|
||||
const { values } = processHistogramLabels(data);
|
||||
|
||||
if (values && values['__name__']) {
|
||||
this.histogramMetrics = values['__name__'].slice().sort();
|
||||
}
|
||||
};
|
||||
|
||||
provideCompletionItems = async (
|
||||
{ prefix, text, value, labelKey, wrapperClasses }: TypeaheadInput,
|
||||
context: AutocompleteContext = {}
|
||||
|
||||
Reference in New Issue
Block a user