20 lines
363 B
Go
20 lines
363 B
Go
package tracker
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/api"
|
|
v1 "github.com/prometheus/client_golang/api/prometheus/v1"
|
|
)
|
|
|
|
type prometheus struct {
|
|
client v1.API
|
|
}
|
|
|
|
func NewPrometheus(address string) (Interface, error) {
|
|
cfg := api.Config{
|
|
Address: address,
|
|
}
|
|
|
|
client, err := api.NewClient(cfg)
|
|
return prometheus{client: v1.NewAPI(client)}, err
|
|
}
|