Skip to content

Commit

Permalink
Fix downsampling option in querier URL
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Biesmans <olivier.biesmans@blablacar.com>
  • Loading branch information
Olivier Biesmans committed Sep 25, 2019
1 parent 749b378 commit e77da40
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 73 deletions.
142 changes: 71 additions & 71 deletions pkg/ui/bindata.go

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion pkg/ui/static/js/graph.js
Expand Up @@ -93,6 +93,8 @@ Prometheus.Graph.prototype.initialize = function() {
self.stacked = self.queryForm.find("input[name=stacked]");
self.insertMetric = self.queryForm.find("select[name=insert_metric]");
self.refreshInterval = self.queryForm.find("select[name=refresh]");
self.maxSourceResolution = self.queryForm.find("select[name=max_source_resolution_input]");


self.consoleTab = graphWrapper.find(".console");
self.graphTab = graphWrapper.find(".graph_container");
Expand Down Expand Up @@ -231,6 +233,8 @@ Prometheus.Graph.prototype.initialize = function() {
stylePartialResponseBtn();
});

self.maxSourceResolution.val(self.options.max_source_resolution_input);

self.queryForm.submit(function() {
self.consoleTab.addClass("reload");
self.graphTab.addClass("reload");
Expand Down Expand Up @@ -377,7 +381,6 @@ Prometheus.Graph.prototype.getOptions = function() {
"range_input",
"end_input",
"step_input",
"downsample_input",
"stacked",
"moment_input"
];
Expand All @@ -390,6 +393,9 @@ Prometheus.Graph.prototype.getOptions = function() {
}
}
});

options.max_source_resolution_input = self.queryForm.find("select[name=max_source_resolution_input]").val();

options.expr = self.expr.val();
options.tab = self.options.tab;
return options;
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/static/js/graph_template.handlebar
Expand Up @@ -115,7 +115,7 @@
<div class="prometheus_input_group pull-left">
<select name="max_source_resolution_input" title="Downsampling option" id="max_source_resolution_input{{id}}">
<option value="">Auto downsampling</option>
<option selected="selected" value="0s">Only raw data</option>
<option value="0s">Only Raw data</option>
<option value="5m">Max 5m downsampling</option>
<option value="1h">Max 1h downsampling</option>
</select>
Expand Down

0 comments on commit e77da40

Please sign in to comment.