|
|
@ -15,6 +15,7 @@ import ( |
|
|
|
opentracing "github.com/opentracing/opentracing-go" |
|
|
|
opentracing "github.com/opentracing/opentracing-go" |
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
"github.com/prometheus/client_golang/prometheus/promauto" |
|
|
|
"github.com/prometheus/client_golang/prometheus/promauto" |
|
|
|
|
|
|
|
"github.com/weaveworks/common/httpgrpc" |
|
|
|
"github.com/weaveworks/common/user" |
|
|
|
"github.com/weaveworks/common/user" |
|
|
|
"google.golang.org/grpc/health/grpc_health_v1" |
|
|
|
"google.golang.org/grpc/health/grpc_health_v1" |
|
|
|
|
|
|
|
|
|
|
@ -221,9 +222,10 @@ func (d *Distributor) Push(ctx context.Context, req *logproto.PushRequest) (*log |
|
|
|
func (d *Distributor) validateLabels(userID, labels string) error { |
|
|
|
func (d *Distributor) validateLabels(userID, labels string) error { |
|
|
|
ls, err := util.ToClientLabels(labels) |
|
|
|
ls, err := util.ToClientLabels(labels) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return httpgrpc.Errorf(http.StatusBadRequest, err.Error()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// everything in `ValidateLabels` returns `httpgrpc.Errorf` errors, no sugaring needed
|
|
|
|
return validation.ValidateLabels(d.overrides, userID, ls) |
|
|
|
return validation.ValidateLabels(d.overrides, userID, ls) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|