|
|
@@ -5,6 +5,7 @@ import (
|
|
|
"io/ioutil"
|
|
|
"net/http"
|
|
|
"net/url"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/log"
|
|
|
@@ -30,7 +31,7 @@ func (e *GraphiteExecutor) Execute(queries tsdb.QuerySlice, context *tsdb.QueryC
|
|
|
result := &tsdb.BatchResult{}
|
|
|
|
|
|
params := url.Values{
|
|
|
- "from": []string{context.TimeRange.From},
|
|
|
+ "from": []string{formatTimeRange(context.TimeRange.From)},
|
|
|
"until": []string{context.TimeRange.To},
|
|
|
"format": []string{"json"},
|
|
|
"maxDataPoints": []string{"500"},
|
|
|
@@ -76,3 +77,7 @@ func (e *GraphiteExecutor) Execute(queries tsdb.QuerySlice, context *tsdb.QueryC
|
|
|
result.QueryResults["A"] = queryRes
|
|
|
return result
|
|
|
}
|
|
|
+
|
|
|
+func formatTimeRange(input string) string {
|
|
|
+ return strings.Replace(strings.Replace(input, "m", "min", -1), "M", "mon", -1)
|
|
|
+}
|