func InfluxDBWithTags(r metrics.Registry, d time.Duration, url, database, username, password string, tags map[string]string) {
	u, err := uurl.Parse(url)
	if err != nil {
		log.Printf("unable to parse InfluxDB url %s. err=%v", url, err)
		return
	}
	rep := &reporter{
		reg:      r,
		interval: d,
		url:      *u,
		database: database,
		username: username,
		password: password,
		tags:     tags,
	}
	if err := rep.makeClient(); err != nil {
		log.Printf("unable to make InfluxDB client. err=%v", err)
		return
	}
	rep.run()
}
InfluxDBWithTags starts a InfluxDB reporter which will post the metrics from the given registry at each d interval with the specified tags
package serverplugin
import (
	"fmt"
	"log"
	uurl "net/url"
	"time"
	client "github.com/influxdata/influxdb1-client"
	"github.com/rcrowley/go-metrics"
)
type reporter struct {
	reg      metrics.Registry
	interval time.Duration
	url      uurl.URL
	database string
	username string
	password string
	tags     map[string]string
	client *client.Client
}
func InfluxDB(r metrics.Registry, d time.Duration, url, database, username, password string) {
	InfluxDBWithTags(r, d, url, database, username, password, nil)
}