From 5c0baae1641c3a824b57a6692a2b9bbb35df914d Mon Sep 17 00:00:00 2001 From: Richard Hillmann Date: Thu, 16 Mar 2017 00:57:25 +0100 Subject: [PATCH] lint issues --- exporter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exporter.go b/exporter.go index f821684..5a57e38 100644 --- a/exporter.go +++ b/exporter.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "errors" "flag" "fmt" "io/ioutil" @@ -135,7 +136,7 @@ func (s *appScraper) stats() (*AppStats, error) { // validate returned json is complete // requestCounter and requestRates should be empty maps, so we are fine here if stats.Duration == nil { - return nil, fmt.Errorf("Invalid JSON returned, could not retreive duration.*") + return nil, errors.New("Invalid JSON returned, could not retrieve duration") } return &stats, err @@ -157,6 +158,7 @@ func (e *Exporter) Describe(ch chan<- *prometheus.Desc) { } +// Collect implements prometheus.Describe.Collect func (e *Exporter) Collect(ch chan<- prometheus.Metric) { stats, err := e.scraper.stats() @@ -205,6 +207,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) { } +// NewExporter creates a new prometheus exporter and app scraper func NewExporter(endpoint string) (*Exporter, error) { if !strings.Contains(endpoint, "://") {