Browse Source

lint issues

master
Richard Hillmann 9 years ago
parent
commit
5c0baae164
  1. 5
      exporter.go

5
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, "://") {

Loading…
Cancel
Save