package et_prometheus_exporter import ( "fmt" "log" "testing" "time" ) func TestApi(t *testing.T) { apiRun() log.Print("=====prometheus apiRun=======") } func doSomethings() { deviceId := fmt.Sprintf("deviceId-%d", time.Now().Unix()) thingId := "11111-1111" collectTime := time.Now().Unix() devLastDataTimeGauge.WithLabelValues(deviceId, thingId).Set(float64(collectTime)) devDataCounter.WithLabelValues(deviceId, thingId, timeStart).Inc() }