Skip to content

Commit bac6c31

Browse files
committed
Remove tz, from, and until parameters from expand handler
1 parent fc33494 commit bac6c31

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

COMPATIBILITY.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ _When `format=png`_ (default if not specified)
102102
* `jsonp` : ...
103103
* `query` : the metric or glob-pattern to find
104104

105+
### /metrics/expand/?
105106

106-
107+
* `query` : the metric or glob-pattern to find
108+
* `jsonp` : ...
109+
* `groupByExpr`: (0 or 1)
110+
* `leavesOnly`: (0 or 1)
107111

108112
## Graphite-web 1.1.7 compatibility
109113
### Unsupported functions

cmd/carbonapi/http/expand_handler.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414

1515
"github.com/go-graphite/carbonapi/carbonapipb"
1616
"github.com/go-graphite/carbonapi/cmd/carbonapi/config"
17-
"github.com/go-graphite/carbonapi/date"
1817
utilctx "github.com/go-graphite/carbonapi/util/ctx"
1918
)
2019

@@ -32,12 +31,6 @@ func expandHandler(w http.ResponseWriter, r *http.Request) {
3231
groupByExpr := r.FormValue("groupByExpr")
3332
leavesOnly := r.FormValue("leavesOnly")
3433

35-
qtz := r.FormValue("tz")
36-
from := r.FormValue("from")
37-
until := r.FormValue("until")
38-
from64 := date.DateParamToEpoch(from, qtz, timeNow().Add(-time.Hour).Unix(), config.Config.DefaultTimeZone)
39-
until64 := date.DateParamToEpoch(until, qtz, timeNow().Unix(), config.Config.DefaultTimeZone)
40-
4134
srcIP, srcPort := splitRemoteAddr(r.RemoteAddr)
4235

4336
accessLogger := zapwriter.Logger("access")
@@ -84,8 +77,6 @@ func expandHandler(w http.ResponseWriter, r *http.Request) {
8477

8578
var pv3Request pbv3.MultiGlobRequest
8679
pv3Request.Metrics = query
87-
pv3Request.StartTime = from64
88-
pv3Request.StopTime = until64
8980

9081
multiGlobs, stats, err := config.Config.ZipperInstance.Find(ctx, pv3Request)
9182
if stats != nil {

cmd/carbonapi/http/helper.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ func (r responseFormat) String() string {
6565

6666
func (r responseFormat) ValidExpandFormat() bool {
6767
switch r {
68+
case treejsonFormat:
69+
return true
6870
case jsonFormat:
6971
return true
7072
default:

0 commit comments

Comments
 (0)