Loki/Prometheus: Improve facetting message in label browser (#40998) (#41047)

* Chore: Improve Loki/Prometheus facetting message in label browser

* Chore: Remove uneeded console log and comment

(cherry picked from commit 8869df2ffe)

Co-authored-by: Devin Smith <me@devinsmith.co.za>
This commit is contained in:
Grot (@grafanabot)
2021-10-28 16:48:15 +02:00
committed by GitHub
co-authored by Devin Smith
parent beb283d16d
commit 42f0612e5a
2 changed files with 2 additions and 6 deletions
@@ -361,9 +361,7 @@ export class UnthemedLokiLabelBrowser extends React.Component<BrowserProps, Brow
return;
}
if (Object.keys(possibleLabels).length === 0) {
// Sometimes the backend does not return a valid set
console.error('No results for label combination, but should not occur.');
this.setState({ error: `Facetting failed for ${selector}` });
this.setState({ error: `Empty results, no matching label for ${selector}` });
return;
}
const labels: SelectableLabel[] = facetLabels(this.state.labels, possibleLabels, lastFacetted);
@@ -433,9 +433,7 @@ export class UnthemedPrometheusMetricsBrowser extends React.Component<BrowserPro
return;
}
if (Object.keys(possibleLabels).length === 0) {
// Sometimes the backend does not return a valid set
console.error('No results for label combination, but should not occur.');
this.setState({ error: `Facetting failed for ${selector}` });
this.setState({ error: `Empty results, no matching label for ${selector}` });
return;
}
const labels: SelectableLabel[] = facetLabels(this.state.labels, possibleLabels, lastFacetted);