diff --git a/CHANGELOG.md b/CHANGELOG.md index f1c3502..7a0bdee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [1.1.0] - 2018-12-10 +### Changed +- Validating the number of InfluxDB line segments (" ") +- Fixed linter violations + +### Added +- Automated Asset builds with goreleaser and Travis CI + ## [1.0.0] - 2018-02-07 ### Added - Exporter basic authentication support (@zsais) diff --git a/main.go b/main.go index 1d2a9c8..31574a2 100644 --- a/main.go +++ b/main.go @@ -170,11 +170,11 @@ func QueryExporter(exporterURL string, auth ExporterAuth) (model.Vector, error) } expResponse, err := client.Do(req) - defer expResponse.Body.Close() if err != nil { return nil, err } + defer expResponse.Body.Close() if expResponse.StatusCode != http.StatusOK { return nil, errors.New("exporter returned non OK HTTP response status: " + expResponse.Status) @@ -244,13 +244,19 @@ func main() { } samples, err = QueryExporter(*exporterURL, auth) + + if err != nil { + _ = fmt.Errorf("%v", err) + os.Exit(2) + } + } else { samples, err = QueryPrometheus(*promURL, *queryString) - } - if err != nil { - _ = fmt.Errorf("%v", err) - os.Exit(2) + if err != nil { + _ = fmt.Errorf("%v", err) + os.Exit(2) + } } err = OutputMetrics(samples, *outputFormat, *metricPrefix)