diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d9fdff7..8c348e8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,10 +16,10 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.18 - name: Install promu package - run: go get -v github.com/prometheus/promu + run: go install -v github.com/prometheus/promu@latest - name: Build run: | diff --git a/Dockerfile b/Dockerfile index 6b72ac9..f2d15fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM golang:1.16-buster as builder +FROM golang:1.18.5-buster as builder WORKDIR /src COPY . . -RUN go get -v github.com/prometheus/promu \ +RUN go install -v github.com/prometheus/promu@latest \ && promu build -v --prefix build diff --git a/collector.go b/collector.go deleted file mode 100644 index 64b33de..0000000 --- a/collector.go +++ /dev/null @@ -1,127 +0,0 @@ -package main - -import ( - "crypto/tls" - "fmt" - "regexp" - "strings" - "time" - - "github.com/prometheus/client_golang/prometheus" -) - -var ( - indexGroupLastTotalBytes = make(map[string]float64) -) - -type Collector struct { - client *Client - - indexSize *prometheus.Desc - indexGroupSize *prometheus.Desc - docsCount *prometheus.Desc - snapshotsCount *prometheus.Desc -} - -func NewCollector(address, project string, repo string, tlsClientConfig *tls.Config) (*Collector, error) { - namespace := "oneday_elasticsearch" - labels := []string{"index", "index_group"} - slabels := []string{"repository"} - labels_group := []string{"index_group"} - - client, err := NewClient([]string{address}, tlsClientConfig) - if err != nil { - return nil, fmt.Errorf("error creating the client: %v", err) - } - - info, err := client.GetInfo() - if err != nil { - return nil, fmt.Errorf("error getting cluster info: %v", err) - } - log.Infof("Cluster info: %v", info) - - cluster := info["cluster_name"].(string) - - constLabels := prometheus.Labels{ - "cluster": cluster, - "project": project, - } - - return &Collector{client: client, - indexSize: prometheus.NewDesc( - prometheus.BuildFQName(namespace, "indices_store", "size_bytes_primary"), - "Size of each index to date", labels, constLabels, - ), - indexGroupSize: prometheus.NewDesc( - prometheus.BuildFQName(namespace, "indices_group_store", "size_bytes"), - "Size of each index to date", labels_group, constLabels, - ), - docsCount: prometheus.NewDesc( - prometheus.BuildFQName(namespace, "indices_docs", "total"), - "Count of docs for each index to date", labels, constLabels, - ), - snapshotsCount: prometheus.NewDesc( - prometheus.BuildFQName(namespace, "snapshots_count", "total"), - "Count of snapshots", slabels, constLabels, - ), - }, nil -} - -func (c *Collector) Describe(ch chan<- *prometheus.Desc) { - ch <- c.indexSize - ch <- c.indexGroupSize - ch <- c.docsCount - ch <- c.snapshotsCount -} - -func (c *Collector) Collect(ch chan<- prometheus.Metric) { - indices, err := c.client.GetIndices([]string{fmt.Sprintf("*-%s", time.Now().Format("2006.01.02"))}) - if err != nil { - log.Fatal("error getting indices stats: ", err) - } - - indexGroupSize := make(map[string]float64) - for index, v := range indices { - // Find date -Y.m.d (-2021.12.01) and replace - reFindDateTime := regexp.MustCompile(`-\d+.\d+.\d+$`) - // Create variable with index prefix - indexGrouplabel := strings.ToLower(reFindDateTime.ReplaceAllString(index, "")) - - data := v.(map[string]interface{}) - primaries := data["primaries"].(map[string]interface{}) - - // docs := primaries["docs"].(map[string]interface{}) - // count := docs["count"].(float64) - docs := primaries["indexing"].(map[string]interface{}) - count := docs["index_total"].(float64) - ch <- prometheus.MustNewConstMetric(c.docsCount, prometheus.GaugeValue, count, index, indexGrouplabel) - - store := primaries["store"].(map[string]interface{}) - size := store["size_in_bytes"].(float64) - ch <- prometheus.MustNewConstMetric(c.indexSize, prometheus.GaugeValue, size, index, indexGrouplabel) - - var lastIndexDifferenceBytes float64 - if _, ok := indexGroupLastTotalBytes[index]; ok { - if size > indexGroupLastTotalBytes[index] { - lastIndexDifferenceBytes = size - indexGroupLastTotalBytes[index] - } else { - lastIndexDifferenceBytes = 0 - } - } - - indexGroupLastTotalBytes[index] = size - indexGroupSize[indexGrouplabel] += lastIndexDifferenceBytes - } - - for indexGroup, v := range indexGroupSize { - ch <- prometheus.MustNewConstMetric(c.indexGroupSize, prometheus.CounterValue, v, indexGroup) - } - if *repoName != "" { - snapshots, err := c.client.GetSnapshots(*repoName) - if err != nil { - log.Fatal("error getting snapshots count: ", err) - } - s := len(snapshots["snapshots"]) - ch <- prometheus.MustNewConstMetric(c.snapshotsCount, prometheus.GaugeValue, float64(s), *repoName) - } -} diff --git a/client.go b/collector/client.go similarity index 53% rename from client.go rename to collector/client.go index 3221cc5..efa8c37 100644 --- a/client.go +++ b/collector/client.go @@ -1,4 +1,4 @@ -package main +package collector import ( "crypto/tls" @@ -7,13 +7,15 @@ import ( "net/http" elasticsearch "github.com/elastic/go-elasticsearch/v7" + "github.com/sirupsen/logrus" ) type Client struct { - es *elasticsearch.Client + es *elasticsearch.Client + logger *logrus.Logger } -func NewClient(addresses []string, tlsClientConfig *tls.Config) (*Client, error) { +func NewClient(logger *logrus.Logger, addresses []string, tlsClientConfig *tls.Config) (*Client, error) { cfg := elasticsearch.Config{ Addresses: addresses, Transport: &http.Transport{ @@ -26,12 +28,12 @@ func NewClient(addresses []string, tlsClientConfig *tls.Config) (*Client, error) return nil, err } - return &Client{es}, nil + return &Client{es: es, logger: logger}, nil } func (c *Client) GetIndices(s []string) (map[string]interface{}, error) { - log.Debug("Getting indices stats: ", s) + c.logger.Debug("Getting indices stats: ", s) resp, err := c.es.Indices.Stats( c.es.Indices.Stats.WithIndex(s...), ) @@ -53,7 +55,7 @@ func (c *Client) GetIndices(s []string) (map[string]interface{}, error) { } func (c *Client) GetSnapshots(sr string) (map[string][]interface{}, error) { - log.Debug("Getting snapshots in: ", sr) + c.logger.Debug("Getting snapshots in: ", sr) resp, err := c.es.Snapshot.Get(sr, []string{"*"}) if err != nil { return nil, fmt.Errorf("error getting response: %s", err) @@ -73,7 +75,7 @@ func (c *Client) GetSnapshots(sr string) (map[string][]interface{}, error) { } func (c *Client) GetInfo() (map[string]interface{}, error) { - log.Debug("Getting cluster info") + c.logger.Debug("Getting cluster info") resp, err := c.es.Info() if err != nil { return nil, fmt.Errorf("error getting response: %s", err) @@ -91,3 +93,48 @@ func (c *Client) GetInfo() (map[string]interface{}, error) { return r, nil } + +func (c *Client) GetMapping(s []string) (map[string]interface{}, error) { + c.logger.Debug("Getting indices mapping: ", s) + resp, err := c.es.Indices.GetMapping( + c.es.Indices.GetMapping.WithIndex(s...), + ) + if err != nil { + return nil, fmt.Errorf("error getting response: %s", err) + } + defer resp.Body.Close() + + if resp.IsError() { + return nil, fmt.Errorf("request failed: %v", resp.String()) + } + + var r map[string]interface{} + if err := json.NewDecoder(resp.Body).Decode(&r); err != nil { + return nil, err + } + + return r, nil +} + +func (c *Client) GetSettings(s []string) (map[string]interface{}, error) { + c.logger.Debug("Getting indices settings: ", s) + resp, err := c.es.Indices.GetSettings( + c.es.Indices.GetSettings.WithIndex(s...), + c.es.Indices.GetSettings.WithIncludeDefaults(true), + ) + if err != nil { + return nil, fmt.Errorf("error getting response: %s", err) + } + defer resp.Body.Close() + + if resp.IsError() { + return nil, fmt.Errorf("request failed: %v", resp.String()) + } + + var r map[string]interface{} + if err := json.NewDecoder(resp.Body).Decode(&r); err != nil { + return nil, err + } + + return r, nil +} diff --git a/collector/collector.go b/collector/collector.go new file mode 100644 index 0000000..ef2d1c2 --- /dev/null +++ b/collector/collector.go @@ -0,0 +1,115 @@ +package collector + +import ( + "crypto/tls" + "fmt" + "strings" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" +) + +const ( + namespace = "oneday_elasticsearch" +) + +var ( + labels = []string{"index", "index_group"} + labels_group = []string{"index_group"} + slabels = []string{"repository"} +) + +func NewCollector(logger *logrus.Logger, address, project string, repo string, tlsClientConfig *tls.Config) error { + client, err := NewClient(logger, []string{address}, tlsClientConfig) + if err != nil { + return fmt.Errorf("error creating the client: %v", err) + } + + info, err := client.GetInfo() + if err != nil { + return fmt.Errorf("error getting cluster info: %v", err) + } + logger.Infof("Cluster info: %v", info) + + cluster := info["cluster_name"].(string) + + constLabels := prometheus.Labels{ + "cluster": cluster, + "project": project, + } + + err = prometheus.Register(NewFieldsCollector(logger, client, labels, labels_group, constLabels)) + if err != nil { + return fmt.Errorf("error registering index fields count collector: %v", err) + } + + err = prometheus.Register(NewIndicesCollector(logger, client, labels, labels_group, constLabels)) + if err != nil { + return fmt.Errorf("error registering indices stats collector: %v", err) + } + + err = prometheus.Register(NewSettingsCollector(logger, client, labels, labels_group, constLabels)) + if err != nil { + return fmt.Errorf("error registering indices settings collector: %v", err) + } + + if repo != "" { + err = prometheus.Register(NewSnapshotCollector(logger, client, repo, slabels, constLabels)) + if err != nil { + return fmt.Errorf("error registering snapshots stats collector: %v", err) + } + } + + return nil +} + +func todayFunc() string { return time.Now().Format("2006.01.02") } + +func indicesPatternFunc(today string) string { return fmt.Sprintf("*-%s", today) } + +// Find date -Y.m.d (-2021.12.01) and replace +func indexGroupLabelFunc(index, today string) string { + return strings.ToLower(strings.TrimSuffix(index, "-"+today)) +} + +// Walk over the json map by path `f1.f2.f3` and return the last field +func walk(m map[string]interface{}, path string) (interface{}, bool) { + p := strings.Split(path, ".") + for _, v := range p[:len(p)-1] { + if v, ok := m[v]; ok { + switch v := v.(type) { + case map[string]interface{}: + m = v + default: + return v, false + } + } + } + + v, ok := m[p[len(p)-1]] + + return v, ok +} + +// Count mapping fields by `type` field +// https://github.com/elastic/elasticsearch/issues/68947#issue-806860754 +func countFields(m map[string]interface{}, count float64) float64 { + if v, ok := m["type"]; ok { + switch v := v.(type) { + case map[string]interface{}: + count = countFields(v, count) + case string: + return count + 1 + } + } + + for _, v := range m { + switch v := v.(type) { + case map[string]interface{}: + count = countFields(v, count) + } + } + + return count +} diff --git a/collector/fields.go b/collector/fields.go new file mode 100644 index 0000000..302aed3 --- /dev/null +++ b/collector/fields.go @@ -0,0 +1,67 @@ +package collector + +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" +) + +type FieldsCollector struct { + client *Client + logger *logrus.Logger + + fieldsCount *prometheus.Desc + fieldsGroupCount *prometheus.Desc +} + +func NewFieldsCollector(logger *logrus.Logger, client *Client, labels, labels_group []string, + constLabels prometheus.Labels) *FieldsCollector { + + return &FieldsCollector{ + client: client, + logger: logger, + fieldsCount: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "fields_count", "total"), + "Count of fields of each index to date", labels, constLabels, + ), + fieldsGroupCount: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "fields_group_count", "total"), + "Total number of fields of each index group to date", labels_group, constLabels, + ), + } +} + +func (c *FieldsCollector) Describe(ch chan<- *prometheus.Desc) { + ch <- c.fieldsCount + ch <- c.fieldsGroupCount +} + +func (c *FieldsCollector) Collect(ch chan<- prometheus.Metric) { + today := todayFunc() + indicesPattern := indicesPatternFunc(today) + + mapping, err := c.client.GetMapping([]string{indicesPattern}) + if err != nil { + c.logger.Fatalf("error getting indices mapping: %v", err) + } + + fieldsGroupCount := make(map[string]float64) + for index, v := range mapping { + // Create variable with index prefix + indexGrouplabel := indexGroupLabelFunc(index, today) + + data, ok := v.(map[string]interface{}) + if !ok { + c.logger.Errorf("got invalid mapping for: %s", index) + } + + count := countFields(data, 0) + + ch <- prometheus.MustNewConstMetric(c.fieldsCount, prometheus.GaugeValue, count, index, indexGrouplabel) + + fieldsGroupCount[indexGrouplabel] += count + } + + for indexGroup, v := range fieldsGroupCount { + ch <- prometheus.MustNewConstMetric(c.fieldsGroupCount, prometheus.GaugeValue, v, indexGroup) + } +} diff --git a/collector/indices.go b/collector/indices.go new file mode 100644 index 0000000..bc58a4c --- /dev/null +++ b/collector/indices.go @@ -0,0 +1,103 @@ +package collector + +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" +) + +var ( + indexGroupLastTotalBytes = make(map[string]float64) +) + +type IndicesCollector struct { + client *Client + logger *logrus.Logger + + indexSize *prometheus.Desc + indexGroupSize *prometheus.Desc + docsCount *prometheus.Desc +} + +func NewIndicesCollector(logger *logrus.Logger, client *Client, labels, labels_group []string, + constLabels prometheus.Labels) *IndicesCollector { + + return &IndicesCollector{ + client: client, + logger: logger, + indexSize: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "indices_store", "size_bytes_primary"), + "Size of each index to date", labels, constLabels, + ), + docsCount: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "indices_docs", "total"), + "Count of docs for each index to date", labels, constLabels, + ), + indexGroupSize: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "indices_group_store", "size_bytes"), + "Total size of each index group to date", labels_group, constLabels, + ), + } +} + +func (c *IndicesCollector) Describe(ch chan<- *prometheus.Desc) { + ch <- c.indexSize + ch <- c.docsCount + ch <- c.indexGroupSize +} + +func (c *IndicesCollector) Collect(ch chan<- prometheus.Metric) { + today := todayFunc() + indicesPattern := indicesPatternFunc(today) + + indices, err := c.client.GetIndices([]string{indicesPattern}) + if err != nil { + c.logger.Fatalf("error getting indices stats: %v", err) + } + + indexGroupSize := make(map[string]float64, len(indices)) + for index, v := range indices { + // Create variable with index prefix + indexGrouplabel := indexGroupLabelFunc(index, today) + + data, ok := v.(map[string]interface{}) + if !ok { + c.logger.Errorf("got invalid index stats for: %s", index) + continue + } + + path := "primaries.indexing.index_total" + if count, ok := walk(data, path); ok { + if v, ok := count.(float64); ok { + ch <- prometheus.MustNewConstMetric(c.docsCount, prometheus.GaugeValue, v, index, indexGrouplabel) + } else { + c.logger.Errorf("got invalid %q value for: %s value: %#v", path, index, count) + } + } else { + c.logger.Errorf("%q was not found for: %s", path, index) + } + + path = "primaries.store.size_in_bytes" + if size, ok := walk(data, path); ok { + if v, ok := size.(float64); ok { + ch <- prometheus.MustNewConstMetric(c.indexSize, prometheus.GaugeValue, v, index, indexGrouplabel) + + var lastIndexDifferenceBytes float64 = 0 + if _, ok := indexGroupLastTotalBytes[index]; ok { + if v > indexGroupLastTotalBytes[index] { + lastIndexDifferenceBytes = v - indexGroupLastTotalBytes[index] + } + } + indexGroupLastTotalBytes[index] = v + indexGroupSize[indexGrouplabel] += lastIndexDifferenceBytes + } else { + c.logger.Errorf("got invalid %q value for: %s value: %#v", path, index, size) + } + } else { + c.logger.Errorf("%q was not found for: %s", path, index) + } + } + + for indexGroup, v := range indexGroupSize { + ch <- prometheus.MustNewConstMetric(c.indexGroupSize, prometheus.CounterValue, v, indexGroup) + } +} diff --git a/collector/settings.go b/collector/settings.go new file mode 100644 index 0000000..4f7f8b4 --- /dev/null +++ b/collector/settings.go @@ -0,0 +1,85 @@ +package collector + +import ( + "strconv" + + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" +) + +type SettingsCollector struct { + client *Client + logger *logrus.Logger + + fieldsLimit *prometheus.Desc + fieldsGroupLimit *prometheus.Desc +} + +func NewSettingsCollector(logger *logrus.Logger, client *Client, labels, labels_group []string, + constLabels prometheus.Labels) *SettingsCollector { + + return &SettingsCollector{ + client: client, + logger: logger, + fieldsLimit: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "fields_limit", "total"), + "Total limit of fields of each index to date", labels, constLabels, + ), + fieldsGroupLimit: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "fields_group_limit", "total"), + "Total limit of fields of each index group to date", labels_group, constLabels, + ), + } +} + +func (c *SettingsCollector) Describe(ch chan<- *prometheus.Desc) { + ch <- c.fieldsLimit + ch <- c.fieldsGroupLimit +} + +func (c *SettingsCollector) Collect(ch chan<- prometheus.Metric) { + today := todayFunc() + indicesPattern := indicesPatternFunc(today) + + settings, err := c.client.GetSettings([]string{indicesPattern}) + if err != nil { + c.logger.Fatalf("error getting indices settings: %v", err) + } + + fieldsGroupLimit := make(map[string]float64) + for index, v := range settings { + // Create variable with index prefix + indexGrouplabel := indexGroupLabelFunc(index, today) + + data, ok := v.(map[string]interface{}) + if !ok { + c.logger.Error("got invalid index setttings for: %s", index) + continue + } + + path := "index.mapping.total_fields.limit" + limit, ok := walk(data, "settings."+path) + if !ok { + limit, ok = walk(data, "defaults."+path) + if !ok { + c.logger.Errorf("%q was not found for: %s", path, index) + continue + } + } + + if s, ok := limit.(string); ok { + if v, err := strconv.ParseFloat(s, 64); err == nil { + ch <- prometheus.MustNewConstMetric(c.fieldsLimit, prometheus.GaugeValue, v, index, indexGrouplabel) + fieldsGroupLimit[indexGrouplabel] += v + } else { + c.logger.Errorf("error parsing %q value for: %s: %v ", path, index, err) + } + } else { + c.logger.Errorf("got invalid %q value for: %s value: %#v", path, index, limit) + } + } + + for indexGroup, v := range fieldsGroupLimit { + ch <- prometheus.MustNewConstMetric(c.fieldsGroupLimit, prometheus.GaugeValue, v, indexGroup) + } +} diff --git a/collector/snapshots.go b/collector/snapshots.go new file mode 100644 index 0000000..ea2a37a --- /dev/null +++ b/collector/snapshots.go @@ -0,0 +1,43 @@ +package collector + +import ( + "github.com/sirupsen/logrus" + + "github.com/prometheus/client_golang/prometheus" +) + +type SnapshotCollector struct { + client *Client + logger logrus.Logger + + repo string + + snapshotsCount *prometheus.Desc +} + +func NewSnapshotCollector(logger *logrus.Logger, client *Client, repo string, labels []string, + constLabels prometheus.Labels) *SnapshotCollector { + + return &SnapshotCollector{ + client: client, + logger: *logger, + repo: repo, + snapshotsCount: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "snapshots_count", "total"), + "Count of snapshots", slabels, constLabels, + ), + } +} + +func (c *SnapshotCollector) Describe(ch chan<- *prometheus.Desc) { + ch <- c.snapshotsCount +} + +func (c *SnapshotCollector) Collect(ch chan<- prometheus.Metric) { + snapshots, err := c.client.GetSnapshots(c.repo) + if err != nil { + c.logger.Fatalf("error getting snapshots count: %v", err) + } + s := len(snapshots["snapshots"]) + ch <- prometheus.MustNewConstMetric(c.snapshotsCount, prometheus.GaugeValue, float64(s), c.repo) +} diff --git a/go.mod b/go.mod index 7ab244f..e93faef 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,25 @@ module github.com/flant/elasticsearch-oneday-exporter -go 1.16 +go 1.17 require ( - github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/elastic/go-elasticsearch/v7 v7.10.0 + github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/common v0.37.0 + github.com/sirupsen/logrus v1.9.0 + gopkg.in/alecthomas/kingpin.v2 v2.2.6 +) + +require ( + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.6 // indirect - github.com/google/go-github v17.0.0+incompatible // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/prometheus/client_golang v1.11.0 - github.com/prometheus/common v0.32.1 - github.com/prometheus/procfs v0.7.3 // indirect - github.com/prometheus/promu v0.13.0 // indirect - github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.7.0 // indirect - golang.org/x/sys v0.0.0-20211102192858-4dd72447c267 // indirect - google.golang.org/protobuf v1.27.1 // indirect - gopkg.in/alecthomas/kingpin.v2 v2.2.6 - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect + github.com/stretchr/testify v1.8.0 // indirect + golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect + google.golang.org/protobuf v1.28.1 // indirect ) diff --git a/go.sum b/go.sum index 13d4b07..27be081 100644 --- a/go.sum +++ b/go.sum @@ -33,16 +33,14 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a h1:E/8AP5dFtMhl5KPJz66Kt9G0n+7Sn41Fy1wv9/jHOrc= -github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -71,9 +69,11 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -115,14 +115,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github/v25 v25.1.3 h1:Ht4YIQgUh4l4lc80fvGnw60khXysXvlgPxPP8uJG3EA= -github.com/google/go-github/v25 v25.1.3/go.mod h1:6z5pC69qHtrPJ0sXPsj4BLnd82b+r6sLB7qcBoRZqpw= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -143,6 +137,7 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -161,19 +156,21 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -182,29 +179,32 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/promu v0.13.0 h1:GOT9G/p1dAh3GdF682cmupq1yjSyCdiRKY3AXU5tV9g= -github.com/prometheus/promu v0.13.0/go.mod h1:fpmnuMB5vg917tcDMbM+rRS3mN6PC/T+fCbnRdyzjJ8= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -213,8 +213,6 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -279,16 +277,16 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -298,6 +296,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -311,7 +310,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -334,15 +332,22 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211102192858-4dd72447c267 h1:7zYaz3tjChtpayGDzu6H0hDAUM5zIGA2XW7kRNgQ0jc= -golang.org/x/sys v0.0.0-20211102192858-4dd72447c267/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -389,7 +394,6 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -412,7 +416,6 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -467,8 +470,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -480,11 +483,10 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go index d97c75d..838e725 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/prometheus/client_golang/prometheus" + "github.com/flant/elasticsearch-oneday-exporter/collector" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/version" "github.com/sirupsen/logrus" @@ -97,13 +97,11 @@ func main() { tlsClientConfig := createTLSConfig(*cacert, *clientcert, *clientkey, *insecure) - collector, err := NewCollector(*address, *projectName, *repoName, tlsClientConfig) + err := collector.NewCollector(log, *address, *projectName, *repoName, tlsClientConfig) if err != nil { - log.Fatal("error creating new collector instance: ", err) + log.Fatalf("error creating new collector instance: %v", err) } - prometheus.MustRegister(collector) - log.Info("Starting server on ", *listenAddress) log.Fatal(http.ListenAndServe(*listenAddress, nil)) } @@ -142,6 +140,7 @@ func setLogFormat(format string) error { } log.SetFormatter(formatter) + log.SetReportCaller(true) return nil }