Skip to content

Commit

Permalink
Add tegrastats.path flag
Browse files Browse the repository at this point in the history
  • Loading branch information
GDWR committed Feb 3, 2024
1 parent 945810e commit 84d913b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/jetson_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ var (
)

func main() {

var (
webConfig = webflag.AddFlags(kingpin.CommandLine, ":9102")
metricsPath = kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
webConfig = webflag.AddFlags(kingpin.CommandLine, ":9102")
metricsPath = kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
tegrastatsPath = kingpin.Flag("tegrastats.path", "Path to tegrastats binary, if not provided will attempt to use $PATH").Default("tegrastats").String()
)

promlogConfig := &promlog.Config{}
Expand All @@ -104,10 +104,10 @@ func main() {
kingpin.Parse()
logger := promlog.New(promlogConfig)

level.Info(logger).Log("msg", "Starting jetson-exporter")
level.Info(logger).Log("msg", "Starting jetson-exporter", "tegraPath", *tegrastatsPath)

go func() {
cmd := exec.Command("tegrastats")
cmd := exec.Command(*tegrastatsPath)

stdout, err := cmd.StdoutPipe()
if err != nil {
Expand Down

0 comments on commit 84d913b

Please sign in to comment.