Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add statistics to query_range and instant_query API. #1615

Merged
merged 16 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ IMAGE_NAMES := $(foreach dir,$(DOCKER_IMAGE_DIRS),$(patsubst %,$(IMAGE_PREFIX)%,
# make BUILD_IN_CONTAINER=false target
# or you can override this with an environment variable
BUILD_IN_CONTAINER ?= true
BUILD_IMAGE_VERSION := 0.9.0
BUILD_IMAGE_VERSION := 0.9.1

# Docker image info
IMAGE_PREFIX ?= grafana
Expand Down
4 changes: 2 additions & 2 deletions loki-build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ COPY --from=drone /go/bin/drone /usr/bin/drone
# It's possible this can be revisited in newer versions of Go if the behavior around GOPATH vs GO111MODULES changes
RUN GO111MODULE=on go get \
github.com/golang/protobuf/protoc-gen-go@v1.3.0 \
github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 \
github.com/gogo/protobuf/gogoproto@v1.3.0 \
github.com/gogo/protobuf/protoc-gen-gogoslick@v1.2.1 \
github.com/gogo/protobuf/gogoproto@v1.2.1 \
github.com/go-delve/delve/cmd/dlv \
# Due to the lack of a proper release tag, we use the commit hash of
# https://github.com/golang/tools/releases v0.1.7
Expand Down
7 changes: 5 additions & 2 deletions pkg/loghttp/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"time"
"unsafe"

"github.com/grafana/loki/pkg/logql/stats"

"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
"github.com/prometheus/common/model"
Expand All @@ -29,8 +31,9 @@ const (

//QueryResponse represents the http json response to a label query
type QueryResponse struct {
Status string `json:"status"`
Data QueryResponseData `json:"data"`
Status string `json:"status"`
Statistics stats.Result `json:"statistics"`
cyriltovena marked this conversation as resolved.
Show resolved Hide resolved
Data QueryResponseData `json:"data"`
}

// PushRequest models a log stream push
Expand Down
Loading