Skip to content

Commit

Permalink
feature: add kernel info to EngineVersion metric
Browse files Browse the repository at this point in the history
Signed-off-by: KevinBetterQ <1093850932@qq.com>
  • Loading branch information
KevinBetterQ committed Jun 4, 2019
1 parent 777292a commit 600d701
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/alibaba/pouch/daemon/config"
"github.com/alibaba/pouch/lxcfs"
"github.com/alibaba/pouch/pkg/debug"
"github.com/alibaba/pouch/pkg/kernel"
"github.com/alibaba/pouch/pkg/utils"
"github.com/alibaba/pouch/storage/quota"
"github.com/alibaba/pouch/version"
Expand Down Expand Up @@ -167,7 +168,15 @@ func runDaemon(cmd *cobra.Command) error {
fmt.Printf("pouchd version: %s, build: %s, build at: %s\n", version.Version, version.GitCommit, version.BuildTime)
return nil
}
metrics.EngineVersion.WithLabelValues(version.GitCommit).Set(1)

kernelVersion, err := kernel.GetKernelVersion()
if err != nil {
return fmt.Errorf("failed to get kernel version: %s", err)
}
metrics.EngineVersion.WithLabelValues(
fmt.Sprintf("%s BUILDTIME:%s Pouch", version.GitCommit, version.BuildTime),
version.Version,
kernelVersion.String()).Set(1)
// initialize log.
initLog()

Expand Down

0 comments on commit 600d701

Please sign in to comment.