Skip to content

Commit

Permalink
ddtrace/tracer: add freebsd osinfo support (DataDog#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanillahsu authored Nov 6, 2020
1 parent 1ef07f6 commit 54f03f4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ddtrace/tracer/osinfo_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2020 Datadog, Inc.

// +build !windows,!linux,!darwin
// +build !windows,!linux,!darwin,!freebsd

package tracer

Expand Down
24 changes: 24 additions & 0 deletions ddtrace/tracer/osinfo_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2020 Datadog, Inc.

package tracer

import (
"os/exec"
"runtime"
"strings"
)

func osName() string {
return runtime.GOOS
}

func osVersion() string {
out, err := exec.Command("uname", "-r").Output()
if err != nil {
return unknown
}
return strings.Split(string(out), "-")[0]
}

0 comments on commit 54f03f4

Please sign in to comment.