Skip to content

Commit

Permalink
made constants unexported to satisfy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Apr 26, 2020
1 parent 0a11be4 commit 8c524ed
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions monitoring/exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
type monitoringService int

const (
Prometheus monitoringService = 1
InfluxDB monitoringService = 2
promService monitoringService = 1
influxService monitoringService = 2
)

const (
Expand Down Expand Up @@ -80,19 +80,19 @@ func main() {

var service monitoringService
if *serveFor == "prometheus" {
service = Prometheus
service = promService
} else if *serveFor == "influxdb" {
service = InfluxDB
service = influxService
} else {
log.Fatal("Invalid monitoring service:" + *serveFor + "; must be either \"prometheus\" or \"influxdb\"")
}
// Validate flags.
switch service {
case Prometheus:
case promService:
if *promMetricsPath == "/" {
log.Fatal("Serving metrics from / is not supported")
}
case InfluxDB:
case influxService:
if *influxOrganization == "" {
log.Fatal("Must specify --influx_organization")
}
Expand All @@ -115,9 +115,9 @@ func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
var servingPath string
switch service {
case Prometheus:
case promService:
servingPath = "<p>Prometheus exporter path: <a href='" + *promMetricsPath + "'>Metrics</a></p>"
case InfluxDB:
case influxService:
servingPath = "<p>InfluxDB push path: <a href='/push'>Push</a></p>"
}

Expand All @@ -137,7 +137,7 @@ func main() {
var serverTypeString string
// Create exporters.
switch service {
case Prometheus:
case promService:
serverTypeString = *serveFor
promExporter := NewPromExporter(*tinodeAddr, *promNamespace, time.Duration(*promTimeout)*time.Second, &scraper)
registry := prometheus.NewRegistry()
Expand All @@ -154,7 +154,7 @@ func main() {
),
),
)
case InfluxDB:
case influxService:
serverTypeString = fmt.Sprintf("%s, version %s", *serveFor, *influxDBVersion)
influxDBExporter := NewInfluxDBExporter(*influxDBVersion, *influxPushAddr, *influxOrganization, *influxBucket,
*influxAuthToken, *instance, &scraper)
Expand Down

0 comments on commit 8c524ed

Please sign in to comment.