Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 chunk/chunk_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/bradfitz/gomemcache/memcache"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
"github.com/weaveworks/scope/common/instrument"
"github.com/weaveworks/common/instrument"
"golang.org/x/net/context"
)

Expand Down
4 changes: 2 additions & 2 deletions chunk/chunk_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/storage/metric"
"github.com/weaveworks/scope/common/instrument"
"github.com/weaveworks/common/instrument"
"golang.org/x/net/context"

"github.com/weaveworks/cortex/user"
"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex/util"
)

Expand Down
2 changes: 1 addition & 1 deletion chunk/chunk_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"

"github.com/weaveworks/cortex/user"
"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex/util"
)

Expand Down
2 changes: 1 addition & 1 deletion chunk/dynamo_table_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
"github.com/weaveworks/common/instrument"
"github.com/weaveworks/common/mtime"
"github.com/weaveworks/scope/common/instrument"
"golang.org/x/net/context"
)

Expand Down
2 changes: 1 addition & 1 deletion chunk/dynamodb_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/scope/common/instrument"
"github.com/weaveworks/common/instrument"
"golang.org/x/net/context"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/querier/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"github.com/prometheus/prometheus/promql"
"github.com/prometheus/prometheus/web/api/v1"

"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex/chunk"
"github.com/weaveworks/cortex/distributor"
"github.com/weaveworks/cortex/querier"
"github.com/weaveworks/cortex/ring"
"github.com/weaveworks/cortex/server"
"github.com/weaveworks/cortex/user"
"github.com/weaveworks/cortex/util"
)

Expand Down Expand Up @@ -51,9 +51,9 @@ func main() {
engine := promql.NewEngine(queryable, nil)
api := v1.NewAPI(engine, querier.DummyStorage{Queryable: queryable})
promRouter := route.New(func(r *http.Request) (context.Context, error) {
userID := r.Header.Get(user.UserIDHeaderName)
userID := r.Header.Get(user.OrgIDHeaderName)
if userID == "" {
return nil, fmt.Errorf("no %s header", user.UserIDHeaderName)
return nil, fmt.Errorf("no %s header", user.OrgIDHeaderName)
}
return user.WithID(r.Context(), userID), nil
}).WithPrefix("/api/prom/api/v1")
Expand Down
6 changes: 2 additions & 4 deletions cortex.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ service Ingester {
rpc MetricsForLabelMatchers(MetricsForLabelMatchersRequest) returns (MetricsForLabelMatchersResponse) {};
}

message WriteResponse {
}
message WriteResponse {}

message QueryRequest {
int64 start_timestamp_ms = 1;
Expand All @@ -33,8 +32,7 @@ message LabelValuesResponse {
repeated string label_values = 1;
}

message UserStatsRequest {
}
message UserStatsRequest {}

message UserStatsResponse {
double ingestion_rate = 1;
Expand Down
6 changes: 3 additions & 3 deletions distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
"github.com/mwitkow/go-grpc-middleware"
"github.com/opentracing/opentracing-go"
"github.com/weaveworks/scope/common/instrument"
"golang.org/x/net/context"
"google.golang.org/grpc"

Expand All @@ -21,11 +20,12 @@ import (
"github.com/prometheus/prometheus/storage/metric"
"github.com/prometheus/prometheus/storage/remote"

"github.com/weaveworks/common/instrument"
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex"
"github.com/weaveworks/cortex/ring"
"github.com/weaveworks/cortex/user"
"github.com/weaveworks/cortex/util"
"github.com/weaveworks/cortex/util/middleware"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/prometheus/prometheus/storage/remote"
"golang.org/x/net/context"

"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex"
cortex_chunk "github.com/weaveworks/cortex/chunk"
"github.com/weaveworks/cortex/ring"
"github.com/weaveworks/cortex/user"
"github.com/weaveworks/cortex/util"
)

Expand Down
2 changes: 1 addition & 1 deletion ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/prometheus/prometheus/storage/metric"
"golang.org/x/net/context"

"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex/chunk"
"github.com/weaveworks/cortex/user"
"github.com/weaveworks/cortex/util"
)

Expand Down
2 changes: 1 addition & 1 deletion ingester/user_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/prometheus/prometheus/storage/metric"
"golang.org/x/net/context"

"github.com/weaveworks/cortex/user"
"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex/util"
)

Expand Down
2 changes: 1 addition & 1 deletion ruler/ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/prometheus/prometheus/rules"
"golang.org/x/net/context"

"github.com/weaveworks/common/user"
"github.com/weaveworks/cortex/chunk"
"github.com/weaveworks/cortex/distributor"
"github.com/weaveworks/cortex/querier"
"github.com/weaveworks/cortex/user"
"github.com/weaveworks/cortex/util"
)

Expand Down
6 changes: 4 additions & 2 deletions ruler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import (
"time"

"github.com/jonboulle/clockwork"
"golang.org/x/net/context"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
"github.com/prometheus/prometheus/rules"
"github.com/weaveworks/scope/common/instrument"
"golang.org/x/net/context"

"github.com/weaveworks/common/instrument"
)

const (
Expand Down
13 changes: 8 additions & 5 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import (
"github.com/mwitkow/go-grpc-middleware"
"github.com/opentracing-contrib/go-stdlib/nethttp"
"github.com/opentracing/opentracing-go"
"github.com/weaveworks/scope/common/middleware"
"google.golang.org/grpc"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"

"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/middleware"

"github.com/weaveworks/cortex/ring"
cortex_grpc_middleware "github.com/weaveworks/cortex/util/middleware"
)

var (
Expand Down Expand Up @@ -69,13 +70,15 @@ func New(cfg Config, r *ring.Ring) *Server {

grpcServer := grpc.NewServer(
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
cortex_grpc_middleware.ServerLoggingInterceptor(cfg.LogSuccess),
cortex_grpc_middleware.ServerInstrumentInterceptor(requestDuration),
middleware.ServerLoggingInterceptor(cfg.LogSuccess),
middleware.ServerInstrumentInterceptor(requestDuration),
otgrpc.OpenTracingServerInterceptor(opentracing.GlobalTracer()),
cortex_grpc_middleware.ServerUserHeaderInterceptor,
middleware.ServerUserHeaderInterceptor,
)),
)

httpgrpc.RegisterHTTPServer(grpcServer, httpgrpc.NewServer(router))

return &Server{
cfg: cfg,
HTTP: router,
Expand Down
4 changes: 2 additions & 2 deletions util/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"github.com/prometheus/common/log"
"golang.org/x/net/context"

"github.com/weaveworks/cortex/user"
"github.com/weaveworks/common/user"
)

// ParseProtoRequest parses a proto from the body of a http request.
func ParseProtoRequest(w http.ResponseWriter, r *http.Request, req proto.Message, compressed bool) (ctx context.Context, abort bool) {
userID := r.Header.Get(user.UserIDHeaderName)
userID := r.Header.Get(user.OrgIDHeaderName)
if userID == "" {
http.Error(w, "", http.StatusUnauthorized)
return nil, true
Expand Down
135 changes: 135 additions & 0 deletions vendor/github.com/sercand/kuberesolver/balancer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading