mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-29 02:01:43 +00:00
Forward OS/Kernel version to checkpoint
Useful to prioritize ebpf testing Also: * Make treatment of kernel release and version consistent across Darwin/Linux
This commit is contained in:
@@ -246,6 +246,7 @@ func appMain(flags appFlags) {
|
||||
checkpoint.CheckInterval(&checkpoint.CheckParams{
|
||||
Product: "scope-app",
|
||||
Version: app.Version,
|
||||
Flags: makeBaseCheckpointFlags(),
|
||||
}, versionCheckPeriod, func(r *checkpoint.CheckResponse, err error) {
|
||||
if err != nil {
|
||||
log.Errorf("Error checking version: %v", err)
|
||||
|
||||
14
prog/main.go
14
prog/main.go
@@ -7,6 +7,7 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -16,6 +17,7 @@ import (
|
||||
"github.com/weaveworks/scope/app"
|
||||
"github.com/weaveworks/scope/common/xfer"
|
||||
"github.com/weaveworks/scope/probe/appclient"
|
||||
"github.com/weaveworks/scope/probe/host"
|
||||
"github.com/weaveworks/scope/probe/kubernetes"
|
||||
"github.com/weaveworks/scope/render"
|
||||
"github.com/weaveworks/weave/common"
|
||||
@@ -215,6 +217,18 @@ func logCensoredArgs() {
|
||||
log.Infof("command line args:%s", prettyPrintedArgs)
|
||||
}
|
||||
|
||||
func makeBaseCheckpointFlags() map[string]string {
|
||||
release, _, err := host.GetKernelReleaseAndVersion()
|
||||
if err != nil {
|
||||
release = "unknown"
|
||||
}
|
||||
return map[string]string{
|
||||
// Inconsistent key (using a dash) to match Weave Net
|
||||
"kernel-version": release,
|
||||
"os": runtime.GOOS,
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
var (
|
||||
flags = flags{}
|
||||
|
||||
@@ -91,7 +91,8 @@ func probeMain(flags probeFlags, targets []appclient.Target) {
|
||||
hostID = hostName // TODO(pb): we should sanitize the hostname
|
||||
)
|
||||
log.Infof("probe starting, version %s, ID %s", version, probeID)
|
||||
checkpointFlags := map[string]string{}
|
||||
|
||||
checkpointFlags := makeBaseCheckpointFlags()
|
||||
if flags.kubernetesEnabled {
|
||||
checkpointFlags["kubernetes_enabled"] = "true"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user