Skip to content

Commit

Permalink
Merge pull request #6 from gfleury/prometheus
Browse files Browse the repository at this point in the history
Adding dockerfile and better keyfying on URLFY
  • Loading branch information
gfleury committed Feb 15, 2019
2 parents 540b173 + d8cec63 commit 3fd9bbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM golang:alpine
RUN mkdir -p /go/src/github.com/gfleury/gstreamtop
ADD . /go/src/github.com/gfleury/gstreamtop/
WORKDIR /go/src/github.com/gfleury/gstreamtop/
RUN go build
CMD ["./gstreamtop"]
12 changes: 11 additions & 1 deletion tablestream/viewdata_aggregated.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,17 @@ func (v *AggregatedViewData) URLIFY(newData interface{}, groupByName []string) (
fmt.Println("Failed to convert URLIFY.")
return "", fmt.Errorf("can't read field")
} else {
return setIfGroupByNotEmpty(strings.Split(value, "?")[0], vdata, groupByName)
// Remove querystring
value = strings.Split(value, "?")[0]
// URL path levels
levels := strings.Split(value, "/")
if len(levels) > 3 {
value = strings.Join(levels[:3], "/")
} else {
value = strings.Join(levels, "/")
}

return setIfGroupByNotEmpty(value, vdata, groupByName)
}
}

Expand Down

0 comments on commit 3fd9bbd

Please sign in to comment.