From f2c5c70362f58d55fdc6d6a97f2a9a0fdf6fed1f Mon Sep 17 00:00:00 2001 From: iguazio-deploy Date: Wed, 10 Apr 2019 19:24:11 +0000 Subject: [PATCH 1/3] Updated TSDB to v0.9.1 --- vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go | 1 + vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/select.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go b/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go index 6a2700e38b0..ce7746d0ef1 100644 --- a/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go +++ b/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/frames.go @@ -609,6 +609,7 @@ func (c *basicColumn) SetDataAt(i int, value interface{}) error { } return nil } + func (c *basicColumn) SetData(d interface{}, size int) error { return errors.New("method not supported") } diff --git a/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/select.go b/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/select.go index 7c31fe8401e..32da950faf0 100644 --- a/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/select.go +++ b/vendor/github.com/v3io/v3io-tsdb/pkg/pquerier/select.go @@ -418,6 +418,7 @@ func (queryCtx *selectQueryContext) createColumnSpecs() ([]columnMeta, map[strin var aggregatesMask aggregate.AggrType var aggregates []aggregate.AggrType var metricInterpolationType InterpolationType + var metricInterpolationTolerance int64 for _, colSpec := range cols { aggregatesMask |= colSpec.function aggregates = append(aggregates, colSpec.function) @@ -425,11 +426,16 @@ func (queryCtx *selectQueryContext) createColumnSpecs() ([]columnMeta, map[strin if metricInterpolationType == 0 { if colSpec.interpolationType != 0 { metricInterpolationType = colSpec.interpolationType + metricInterpolationTolerance = colSpec.interpolationTolerance } } else if colSpec.interpolationType != 0 && colSpec.interpolationType != metricInterpolationType { return nil, nil, fmt.Errorf("multiple interpolation for the same metric are not supported, got %v and %v", metricInterpolationType.String(), colSpec.interpolationType.String()) + } else if metricInterpolationTolerance != colSpec.interpolationTolerance { + return nil, nil, fmt.Errorf("different interpolation tolerances for the same metric are not supported, got %v and %v", + metricInterpolationTolerance, + colSpec.interpolationTolerance) } } @@ -446,10 +452,12 @@ func (queryCtx *selectQueryContext) createColumnSpecs() ([]columnMeta, map[strin // After creating all columns set their interpolation function for i := 0; i < len(columnsSpecByMetric[metric]); i++ { columnsSpecByMetric[metric][i].interpolationType = metricInterpolationType + columnsSpecByMetric[metric][i].interpolationTolerance = metricInterpolationTolerance } for i, col := range columnsSpec { if col.metric == metric { columnsSpec[i].interpolationType = metricInterpolationType + columnsSpec[i].interpolationTolerance = metricInterpolationTolerance } } } From 47575ff1168da052e8bda50bb2d43c09e9765a30 Mon Sep 17 00:00:00 2001 From: Gal Topper Date: Tue, 30 Apr 2019 11:41:39 +0300 Subject: [PATCH 2/3] IG-11657: Add health check logs. (#38) * IG-11657: Add health check logs. * Revert change to imports. * Add more logs. --- web/web.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/web.go b/web/web.go index e6f19452279..e0cf0257cfd 100644 --- a/web/web.go +++ b/web/web.go @@ -341,6 +341,7 @@ func New(logger log.Logger, o *Options) *Handler { router.Get("/-/healthy", func(w http.ResponseWriter, r *http.Request) { if o.V3ioConfig == nil { w.WriteHeader(http.StatusInternalServerError) + level.Warn(h.logger).Log("msg", "Prometheus is Unhealthy: still waiting on V3IO storage.") fmt.Fprintf(w, "Prometheus is Unhealthy: still waiting on V3IO storage.\n") return } @@ -348,6 +349,7 @@ func New(logger log.Logger, o *Options) *Handler { req, err := http.NewRequest("GET", schemaUrl, nil) if err != nil { w.WriteHeader(http.StatusInternalServerError) + level.Warn(h.logger).Log("msg", "Prometheus is Unhealthy.", "error", err) fmt.Fprintf(w, "Prometheus is Unhealthy: %v\n", err) return } @@ -363,24 +365,29 @@ func New(logger log.Logger, o *Options) *Handler { resp, err := client.Do(req) if err != nil { w.WriteHeader(http.StatusInternalServerError) + level.Warn(h.logger).Log("msg", "Prometheus is Unhealthy.", "error", err) fmt.Fprintf(w, "Prometheus is Unhealthy: %v\n", err) return } if resp.StatusCode != http.StatusOK { w.WriteHeader(http.StatusInternalServerError) + level.Warn(h.logger).Log("msg", "Prometheus is Unhealthy because it could not find schema file.", "schemaUrl", schemaUrl, "response", resp) fmt.Fprintf(w, "Prometheus is Unhealthy because it could not find %s: %+v\n", schemaUrl, resp) return } w.WriteHeader(http.StatusOK) + level.Info(h.logger).Log("msg", "Prometheus is Healthy.") fmt.Fprintf(w, "Prometheus is Healthy.\n") }) router.Get("/-/ready", readyf(func(w http.ResponseWriter, r *http.Request) { if o.V3ioConfig == nil { w.WriteHeader(http.StatusInternalServerError) + level.Warn(h.logger).Log("msg", "Prometheus is not ready: still waiting on V3IO storage.") fmt.Fprintf(w, "Prometheus is not ready: still waiting on V3IO storage.\n") return } w.WriteHeader(http.StatusOK) + level.Info(h.logger).Log("msg", "Prometheus is Ready.") fmt.Fprintf(w, "Prometheus is Ready.\n") })) From 8c7a02d93976fd336e2a16a947a3af88fb9d3196 Mon Sep 17 00:00:00 2001 From: Gal Topper Date: Tue, 30 Apr 2019 16:11:29 +0300 Subject: [PATCH 3/3] IG-11657: Fix health check. (#39) --- web/web.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/web.go b/web/web.go index e0cf0257cfd..e0f25d2010e 100644 --- a/web/web.go +++ b/web/web.go @@ -354,9 +354,9 @@ func New(logger log.Logger, o *Options) *Handler { return } req.Header.Add("X-v3io-function", "GetItem") - req.Body = ioutil.NopCloser(strings.NewReader(`{AttibutesToGet:"__name"}`)) + req.Body = ioutil.NopCloser(strings.NewReader(`{"AttributesToGet":"__name"}`)) if o.V3ioConfig.AccessKey != "" { - req.Header.Add("X-v3io-access-key", o.V3ioConfig.AccessKey) + req.Header.Add("X-v3io-session-key", o.V3ioConfig.AccessKey) } else if o.V3ioConfig.Password != "" { base64UserPassword := base64.StdEncoding.EncodeToString([]byte(o.V3ioConfig.Username + ":" + o.V3ioConfig.Password)) req.Header.Add("Authorization", "Basic "+base64UserPassword)