|
@ -20,6 +20,7 @@ import ( |
|
|
// "github.com/tzneal/ham-go/dxcc"
|
|
|
// "github.com/tzneal/ham-go/dxcc"
|
|
|
// "github.com/denzs/wsjtx-dashboards/shared/httpstuff"
|
|
|
// "github.com/denzs/wsjtx-dashboards/shared/httpstuff"
|
|
|
"github.com/hpcloud/tail" |
|
|
"github.com/hpcloud/tail" |
|
|
|
|
|
"github.com/prometheus/client_golang/prometheus/promhttp" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var alltxt string |
|
|
var alltxt string |
|
@ -55,6 +56,13 @@ func init() { |
|
|
FullTimestamp: true, |
|
|
FullTimestamp: true, |
|
|
} |
|
|
} |
|
|
log.SetFormatter(formatter) |
|
|
log.SetFormatter(formatter) |
|
|
|
|
|
|
|
|
|
|
|
log.Info("prometheus exporter enabled..") |
|
|
|
|
|
go func () { |
|
|
|
|
|
server := http.NewServeMux() |
|
|
|
|
|
server.Handle("/metrics", promhttp.Handler()) |
|
|
|
|
|
http.ListenAndServe(":9123", server) |
|
|
|
|
|
} () |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func getTimestampFromDb() (int64, bool) { |
|
|
func getTimestampFromDb() (int64, bool) { |
|
|