Skip to content

Commit 7a85812

Browse files
jojohappybwplotka
authored andcommitted
rule & querier: Upgrade UI to Prometheus 2.9.1 version (#1066)
* Upgrade Thanos ui Signed-off-by: jojohappy <sarahdj0917@gmail.com> * Upgrade thanos ui Signed-off-by: jojohappy <sarahdj0917@gmail.com> * Add CHANGELOG Signed-off-by: jojohappy <sarahdj0917@gmail.com> * Update gitignore Signed-off-by: jojohappy <sarahdj0917@gmail.com> * Fixed missing template function Signed-off-by: jojohappy <sarahdj0917@gmail.com> * Update CHANGELOG Signed-off-by: jojohappy <sarahdj0917@gmail.com>
1 parent a6babe1 commit 7a85812

File tree

82 files changed

+33865
-10349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+33865
-10349
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/prometheus
22
/thanos
3-
vendor/
3+
/vendor/
44

55
# Ignore minikube setup working dirs.
66
kube/bin

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,23 @@ We use *breaking* word for marking changes that are not backward compatible (rel
1111

1212
## Unreleased
1313

14+
### Changed
15+
16+
- [#1066](https://github.com/improbable-eng/thanos/pull/1066) Upgrade Thanos ui to Prometheus v2.9.1.
17+
18+
Changes from the upstream:
19+
* query:
20+
- [ENHANCEMENT] Update moment.js and moment-timezone.js [PR #4679](https://github.com/prometheus/prometheus/pull/4679)
21+
- [ENHANCEMENT] Support to query elements by a specific time [PR #4764](https://github.com/prometheus/prometheus/pull/4764)
22+
- [ENHANCEMENT] Update to Bootstrap 4.1.3 [PR #5192](https://github.com/prometheus/prometheus/pull/5192)
23+
- [BUGFIX] Limit number of merics in prometheus UI [PR #5139](https://github.com/prometheus/prometheus/pull/5139)
24+
- [BUGFIX] Web interface Quality of Life improvements [PR #5201](https://github.com/prometheus/prometheus/pull/5201)
25+
* rule:
26+
- [ENHANCEMENT] Improve rule views by wrapping lines [PR #4702](https://github.com/prometheus/prometheus/pull/4702)
27+
- [ENHANCEMENT] Show rule evaluation errors on rules page [PR #4457](https://github.com/prometheus/prometheus/pull/4457)
28+
1429
### Fixed
30+
1531
- [#1144](https://github.com/improbable-eng/thanos/pull/1144) Query/API: properly pass the downsampling parameter. Before this, wrong max resolution of the metrics data might have been selected.
1632

1733
## [v0.4.0](https://github.com/improbable-eng/thanos/releases/tag/v0.4.0) - 2019.05.3

pkg/ui/bindata.go

Lines changed: 809 additions & 169 deletions
Large diffs are not rendered by default.

pkg/ui/rule.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"path"
99
"regexp"
1010
"sort"
11+
"time"
1112

1213
"github.com/go-kit/kit/log"
1314
thanosrule "github.com/improbable-eng/thanos/pkg/rule"
@@ -37,6 +38,9 @@ func NewRuleUI(logger log.Logger, ruleManagers map[storepb.PartialResponseStrate
3738

3839
func ruleTmplFuncs(queryURL string) template.FuncMap {
3940
return template.FuncMap{
41+
"since": func(t time.Time) time.Duration {
42+
return time.Since(t) / time.Millisecond * time.Millisecond
43+
},
4044
"alertStateToClass": func(as rules.AlertState) string {
4145
switch as {
4246
case rules.StateInactive:
@@ -49,6 +53,16 @@ func ruleTmplFuncs(queryURL string) template.FuncMap {
4953
panic("unknown alert state")
5054
}
5155
},
56+
"ruleHealthToClass": func(rh rules.RuleHealth) string {
57+
switch rh {
58+
case rules.HealthUnknown:
59+
return "warning"
60+
case rules.HealthGood:
61+
return "success"
62+
default:
63+
return "danger"
64+
}
65+
},
5266
"queryURL": func() string { return queryURL },
5367
"reReplaceAll": func(pattern, repl, text string) string {
5468
re := regexp.MustCompile(pattern)

pkg/ui/static/css/alerts.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ div.show-annotations button {
2121
border: none;
2222
outline: none;
2323
padding: 0;
24+
color: inherit;
2425
}
2526

2627
div.show-annotations.is-checked {

pkg/ui/static/css/graph.css

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ body {
66
font-size: 11px;
77
}
88

9+
div.query-history {
10+
font-size: 0.8em;
11+
padding-top: 1em;
12+
}
13+
14+
div.query-history:hover {
15+
cursor: pointer;
16+
}
17+
18+
div.query-history button {
19+
background-color: transparent;
20+
border: none;
21+
outline: none;
22+
padding: 0;
23+
color: inherit;
24+
}
25+
26+
div.query-history.is-checked {
27+
color: #286090;
28+
}
29+
30+
div.page-options {
31+
display: flex;
32+
}
33+
934
.graph_wrapper {
1035
margin-top: 12px;
1136
}
@@ -130,12 +155,7 @@ input[name="end_input"], input[name="range_input"] {
130155
margin-right: -1px;
131156
}
132157

133-
.error {
134-
padding: 5px;
135-
margin: 2px;
136-
}
137-
138-
.warnings {
158+
.error, .warning {
139159
padding: 5px;
140160
margin: 2px;
141161
}
@@ -160,12 +180,16 @@ input[name="end_input"], input[name="range_input"] {
160180

161181
.prometheus_input_group .btn {
162182
font-size: 0.8em;
183+
border-color: #ccc;
184+
}
185+
186+
.prometheus_input_group .timepicker-picker .btn {
187+
border-color: transparent;
163188
}
164189

165190
.prometheus_input_group .input {
166191
width: 100px;
167-
height: 29px;
168-
padding: 6px 12px;
192+
padding: 5px 12px 6px 12px;
169193
font-size: 14px;
170194
line-height: 1.42857143;
171195
color: #555;
@@ -189,11 +213,15 @@ input[name="end_input"], input[name="range_input"] {
189213
}
190214

191215
.expression_select {
192-
width: 210px !important;
216+
width: 220px !important;
193217
margin-left: 7px;
194218
}
195219

196220
.graph_container .rickshaw_legend {
197221
background-color: #222222;
198222
border-radius: 0;
199223
}
224+
225+
li.active, .dropdown-item:focus, .dropdown-item:hover {
226+
background-color: steelblue;
227+
}

pkg/ui/static/css/prometheus.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/* Move down content because we have a fixed navbar that is 50px tall */
1+
/* Move down content because we have a fixed navbar that is 50px tall with 20px padding */
22
body {
3-
padding-top: 50px;
3+
padding-top: 70px;
44
padding-bottom: 20px;
55
}
66

@@ -20,3 +20,12 @@ body {
2020
max-width: none;
2121
text-align: left;
2222
}
23+
24+
.label {
25+
white-space: normal;
26+
}
27+
28+
/* The navbar adds horizontal padding already */
29+
.navbar .container-fluid {
30+
padding: 0;
31+
}

pkg/ui/static/css/rules.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ table th tr td h2 {
55
font-size: 26px;
66
}
77
.rule_cell {
8-
white-space: pre;
8+
white-space: pre-wrap;
99
background-color: #F5F5F5;
1010
display: block;
1111
font-family: monospace;

0 commit comments

Comments
 (0)