mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
UI: Handle histograms without buckets
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
654c07783c
commit
c9f9ff9aa8
|
@ -169,11 +169,13 @@ export const HistogramString: FC<HistogramStringProps> = ({ h }) => {
|
||||||
}
|
}
|
||||||
const buckets: string[] = [];
|
const buckets: string[] = [];
|
||||||
|
|
||||||
|
if (h.buckets) {
|
||||||
for (const bucket of h.buckets) {
|
for (const bucket of h.buckets) {
|
||||||
const left = bucket[0] === 3 || bucket[0] === 1 ? '[' : '(';
|
const left = bucket[0] === 3 || bucket[0] === 1 ? '[' : '(';
|
||||||
const right = bucket[0] === 3 || bucket[0] === 0 ? ']' : ')';
|
const right = bucket[0] === 3 || bucket[0] === 0 ? ']' : ')';
|
||||||
buckets.push(left + bucket[1] + ',' + bucket[2] + right + ':' + bucket[3] + ' ');
|
buckets.push(left + bucket[1] + ',' + bucket[2] + right + ':' + bucket[3] + ' ');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -7,7 +7,7 @@ export interface Metric {
|
||||||
export interface Histogram {
|
export interface Histogram {
|
||||||
count: string;
|
count: string;
|
||||||
sum: string;
|
sum: string;
|
||||||
buckets: [number, string, string, string][];
|
buckets?: [number, string, string, string][];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Exemplar {
|
export interface Exemplar {
|
||||||
|
|
Loading…
Reference in a new issue