Commit b7744b49 by utkarshcmu

Added tags and filters params to alerting

parent 35f93f41
......@@ -14,7 +14,6 @@ import (
"io/ioutil"
"net/http"
"net/url"
"net/http/httputil"
"encoding/json"
"gopkg.in/guregu/null.v3"
......@@ -103,6 +102,18 @@ func (e *OpenTsdbExecutor) Execute(ctx context.Context, queries tsdb.QuerySlice,
metric["rateOptions"] = rateOptions
}
// Setting tags
tags, tagsCheck := queries[i].Model.CheckGet("tags")
if tagsCheck && len(tags.MustMap()) > 0 {
metric["tags"] = tags.MustMap()
}
// Setting filters
filters, filtersCheck := queries[i].Model.CheckGet("filters")
if filtersCheck && len(filters.MustArray()) > 0 {
metric["filters"] = filters.MustArray()
}
tsdbQuery.Queries[i] = metric
}
......@@ -148,13 +159,6 @@ func (e *OpenTsdbExecutor) createRequest(data OpenTsdbQuery) (*http.Request, err
req.SetBasicAuth(e.BasicAuthUser, e.BasicAuthPassword)
}
requestDump, err := httputil.DumpRequest(req, true)
if err != nil {
fmt.Println(err)
}
fmt.Println(string(requestDump))
return req, err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment