mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-22 14:32:35 +00:00
.
This commit is contained in:
parent
3be0c9ecd9
commit
1e66ebd8b3
@ -1,7 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "github.com/up9inc/mizu/cli/cmd"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/up9inc/mizu/cli/cmd"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
fmt.Println("Running mizu...")
|
||||||
cmd.Execute()
|
cmd.Execute()
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,13 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var TELEMETRY_URL = "https://us-east4-up9-prod.cloudfunctions.net/mizu-telemetry"
|
||||||
|
|
||||||
func ReportRun(cmd string, args interface{}) {
|
func ReportRun(cmd string, args interface{}) {
|
||||||
if Branch != "main" {
|
if Branch != "main" {
|
||||||
rlog.Debugf("reporting only on main branch")
|
rlog.Debugf("reporting only on main branch")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
url := "https://us-east4-up9-prod.cloudfunctions.net/mizu-telemetry"
|
|
||||||
|
|
||||||
argsBytes, _ := json.Marshal(args)
|
argsBytes, _ := json.Marshal(args)
|
||||||
argsMap := map[string]string{"telemetry_type": "mizu_execution", "cmd": cmd, "args": string(argsBytes), "component": "mizu_cli"}
|
argsMap := map[string]string{"telemetry_type": "mizu_execution", "cmd": cmd, "args": string(argsBytes), "component": "mizu_cli"}
|
||||||
@ -21,7 +22,7 @@ func ReportRun(cmd string, args interface{}) {
|
|||||||
|
|
||||||
jsonValue, _ := json.Marshal(argsMap)
|
jsonValue, _ := json.Marshal(argsMap)
|
||||||
|
|
||||||
if resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonValue)); err != nil {
|
if resp, err := http.Post(TELEMETRY_URL, "application/json", bytes.NewBuffer(jsonValue)); err != nil {
|
||||||
rlog.Debugf("error sending telemtry err: %v, response %v", err, resp)
|
rlog.Debugf("error sending telemtry err: %v, response %v", err, resp)
|
||||||
} else {
|
} else {
|
||||||
rlog.Debugf("Successfully reported telemetry")
|
rlog.Debugf("Successfully reported telemetry")
|
||||||
|
Loading…
Reference in New Issue
Block a user