mirror of https://github.com/prometheus/prometheus
Browse Source
Thanks to input by @nexucis :) Signed-off-by: Julius Volz <julius.volz@gmail.com>pull/14448/head
Julius Volz
9 months ago
10 changed files with 5686 additions and 11279 deletions
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,14 @@
|
||||
module.exports = { |
||||
plugins: { |
||||
'postcss-preset-mantine': {}, |
||||
'postcss-simple-vars': { |
||||
variables: { |
||||
'mantine-breakpoint-xs': '36em', |
||||
'mantine-breakpoint-sm': '48em', |
||||
'mantine-breakpoint-md': '62em', |
||||
'mantine-breakpoint-lg': '75em', |
||||
'mantine-breakpoint-xl': '88em', |
||||
}, |
||||
}, |
||||
}, |
||||
}; |
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,11 @@
|
||||
--- web/ui/react-app/src/images/prometheus_logo_grey.svg |
||||
+++ web/ui/react-app/src/images/prometheus_logo_grey.svg |
||||
@@ -6,14 +6,8 @@ |
||||
<g id="Layer_2"> |
||||
</g> |
||||
<g> |
||||
<path fill="#EEEEEE" d="M56.667,0.667C25.372,0.667,0,26.036,0,57.332c0,31.295,25.372,56.666,56.667,56.666 s56.666-25.371,56.666-56.666C113.333,26.036,87.961,0.667,56.667,0.667z M56.667,106.722c-8.904,0-16.123-5.948-16.123-13.283 H72.79C72.79,100.773,65.571,106.722,56.667,106.722z M83.297,89.04H30.034v-9.658h53.264V89.04z M83.106,74.411h-52.92 c-0.176-0.203-0.356-0.403-0.526-0.609c-5.452-6.62-6.736-10.076-7.983-13.598c-0.021-0.116,6.611,1.355,11.314,2.413 c0,0,2.42,0.56,5.958,1.205c-3.397-3.982-5.414-9.044-5.414-14.218c0-11.359,8.712-21.285,5.569-29.308 c3.059,0.249,6.331,6.456,6.552,16.161c3.252-4.494,4.613-12.701,4.613-17.733c0-5.21,3.433-11.262,6.867-11.469 c-3.061,5.045,0.793,9.37,4.219,20.099c1.285,4.03,1.121,10.812,2.113,15.113C63.797,33.534,65.333,20.5,71,16 c-2.5,5.667,0.37,12.758,2.333,16.167c3.167,5.5,5.087,9.667,5.087,17.548c0,5.284-1.951,10.259-5.242,14.148 c3.742-0.702,6.326-1.335,6.326-1.335l12.152-2.371C91.657,60.156,89.891,67.418,83.106,74.411z"> |
||||
<animate id="flameAnimation" dur="1s" begin="indefinite" repeatCount="indefinite" attributeName="d" values="M56.667,0.667C25.372,0.667,0,26.036,0,57.332c0,31.295,25.372,56.666,56.667,56.666 s56.666-25.371,56.666-56.666C113.333,26.036,87.961,0.667,56.667,0.667z M56.667,106.722c-8.904,0-16.123-5.948-16.123-13.283 H72.79C72.79,100.773,65.571,106.722,56.667,106.722z M83.297,89.04H30.034v-9.658h53.264V89.04z M83.106,74.411h-52.92 c-0.176-0.203-0.356-0.403-0.526-0.609c-5.452-6.62-6.736-10.076-7.983-13.598c-0.021-0.116,6.611,1.355,11.314,2.413 c0,0,2.42,0.56,5.958,1.205c-3.397-3.982-5.414-9.044-5.414-14.218c0-11.359,8.712-21.285,5.569-29.308 c3.059,0.249,6.331,6.456,6.552,16.161c3.252-4.494,4.613-12.701,4.613-17.733c0-5.21,3.433-11.262,6.867-11.469 c-3.061,5.045,0.793,9.37,4.219,20.099c1.285,4.03,1.121,10.812,2.113,15.113C63.797,33.534,65.333,20.5,71,16 c-2.5,5.667,0.37,12.758,2.333,16.167c3.167,5.5,5.087,9.667,5.087,17.548c0,5.284-1.951,10.259-5.242,14.148 c3.742-0.702,6.326-1.335,6.326-1.335l12.152-2.371C91.657,60.156,89.891,67.418,83.106,74.411z;m 56.666,0.667 c 31.295,0 56.667,25.369 56.667,56.665 0,31.295 -25.372,56.666 -56.667,56.666 C 25.371,113.998 0,88.627 0,57.332 0,26.036 25.372,0.667 56.666,0.667 Z m 0,106.055 c 8.904,0 16.123,-5.948 16.123,-13.283 H 40.543 c 0,7.334 7.219,13.283 16.123,13.283 z M 30.036,89.04 H 83.299 V 79.382 H 30.035 v 9.658 z m 0.191,-14.629 h 52.92 c 0.176,-0.203 0.356,-0.403 0.526,-0.609 5.452,-6.62 6.736,-10.076 7.983,-13.598 0.021,-0.116 -6.611,1.355 -11.314,2.413 0,0 -2.42,0.56 -5.958,1.205 3.397,-3.982 5.414,-9.044 5.414,-14.218 0,-11.359 -8.712,-21.285 -5.569,-29.308 -3.059,0.249 -6.331,6.456 -6.552,16.161 -3.252,-4.494 -4.613,-12.701 -4.613,-17.733 0,-5.21 -3.433,-11.262 -6.867,-11.469 3.061,5.045 -0.793,9.37 -4.219,20.099 -1.285,4.03 -1.121,10.812 -2.113,15.113 C 49.536,33.534 48,20.5 42.333,16 c 2.5,5.667 -0.37,12.758 -2.333,16.167 -3.167,5.5 -5.087,9.667 -5.087,17.548 0,5.284 1.951,10.259 5.242,14.148 -3.742,-0.702 -6.326,-1.335 -6.326,-1.335 L 21.677,60.157 c -0.001,-10e-4 1.765,7.261 8.55,14.254 z;M56.667,0.667C25.372,0.667,0,26.036,0,57.332c0,31.295,25.372,56.666,56.667,56.666 s56.666-25.371,56.666-56.666C113.333,26.036,87.961,0.667,56.667,0.667z M56.667,106.722c-8.904,0-16.123-5.948-16.123-13.283 H72.79C72.79,100.773,65.571,106.722,56.667,106.722z M83.297,89.04H30.034v-9.658h53.264V89.04z M83.106,74.411h-52.92 c-0.176-0.203-0.356-0.403-0.526-0.609c-5.452-6.62-6.736-10.076-7.983-13.598c-0.021-0.116,6.611,1.355,11.314,2.413 c0,0,2.42,0.56,5.958,1.205c-3.397-3.982-5.414-9.044-5.414-14.218c0-11.359,8.712-21.285,5.569-29.308 c3.059,0.249,6.331,6.456,6.552,16.161c3.252-4.494,4.613-12.701,4.613-17.733c0-5.21,3.433-11.262,6.867-11.469 c-3.061,5.045,0.793,9.37,4.219,20.099c1.285,4.03,1.121,10.812,2.113,15.113C63.797,33.534,65.333,20.5,71,16 c-2.5,5.667,0.37,12.758,2.333,16.167c3.167,5.5,5.087,9.667,5.087,17.548c0,5.284-1.951,10.259-5.242,14.148 c3.742-0.702,6.326-1.335,6.326-1.335l12.152-2.371C91.657,60.156,89.891,67.418,83.106,74.411z" /> |
||||
</path> |
||||
</g> |
||||
</svg> |
@ -0,0 +1,62 @@
|
||||
/** |
||||
* Inspired by a similar feature in VictoriaMetrics. |
||||
* See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3384 for more details.
|
||||
* Developed by VictoriaMetrics team. |
||||
*/ |
||||
|
||||
import { GraphExemplar, GraphProps, GraphSeries } from './Graph'; |
||||
|
||||
export function isHistogramData(data: GraphProps['data']) { |
||||
if (!data?.result?.length) return false; |
||||
const result = data.result; |
||||
if (result.length < 2) return false; |
||||
const histogramLabels = ['le']; |
||||
|
||||
const firstLabels = Object.keys(result[0].metric).filter((n) => !histogramLabels.includes(n)); |
||||
const isHistogram = result.every((r) => { |
||||
const labels = Object.keys(r.metric).filter((n) => !histogramLabels.includes(n)); |
||||
return firstLabels.length === labels.length && labels.every((l) => r.metric[l] === result[0].metric[l]); |
||||
}); |
||||
|
||||
return isHistogram && result.every((r) => histogramLabels.some((l) => l in r.metric)); |
||||
} |
||||
|
||||
export function prepareHistogramData(buckets: GraphSeries[]) { |
||||
if (!buckets.every((a) => a.labels.le)) return buckets; |
||||
|
||||
const sortedBuckets = buckets.sort((a, b) => promValueToNumber(a.labels.le) - promValueToNumber(b.labels.le)); |
||||
const result: GraphSeries[] = []; |
||||
|
||||
for (let i = 0; i < sortedBuckets.length; i++) { |
||||
const values = []; |
||||
const { data, labels, color } = sortedBuckets[i]; |
||||
|
||||
for (const [timestamp, value] of data) { |
||||
const prevVal = sortedBuckets[i - 1]?.data.find((v) => v[0] === timestamp)?.[1] || 0; |
||||
const newVal = Number(value) - +prevVal; |
||||
values.push([Number(timestamp), newVal]); |
||||
} |
||||
|
||||
result.push({ |
||||
data: values, |
||||
labels, |
||||
color, |
||||
index: i, |
||||
}); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
export function promValueToNumber(s: string) { |
||||
switch (s) { |
||||
case 'NaN': |
||||
return NaN; |
||||
case 'Inf': |
||||
case '+Inf': |
||||
return Infinity; |
||||
case '-Inf': |
||||
return -Infinity; |
||||
default: |
||||
return parseFloat(s); |
||||
} |
||||
} |
Loading…
Reference in new issue