move runtime debug funcs in own package (#4494)
To make local debuging with `go run` easyer moved all files into a dedicate package `runtime`. This allows running prometheus just by using `go run main.go` instead of passing mani files like `go run main.go limits_default.go ...` Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
parent
f3b7c22827
commit
12fe204ea6
|
@ -39,6 +39,7 @@ import (
|
|||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/common/model"
|
||||
"github.com/prometheus/common/version"
|
||||
prom_runtime "github.com/prometheus/prometheus/pkg/runtime"
|
||||
"gopkg.in/alecthomas/kingpin.v2"
|
||||
k8s_runtime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
|
||||
|
@ -229,9 +230,9 @@ func main() {
|
|||
|
||||
level.Info(logger).Log("msg", "Starting Prometheus", "version", version.Info())
|
||||
level.Info(logger).Log("build_context", version.BuildContext())
|
||||
level.Info(logger).Log("host_details", Uname())
|
||||
level.Info(logger).Log("fd_limits", FdLimits())
|
||||
level.Info(logger).Log("vm_limits", VmLimits())
|
||||
level.Info(logger).Log("host_details", prom_runtime.Uname())
|
||||
level.Info(logger).Log("fd_limits", prom_runtime.FdLimits())
|
||||
level.Info(logger).Log("vm_limits", prom_runtime.VmLimits())
|
||||
|
||||
var (
|
||||
localStorage = &tsdb.ReadyStorage{}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// +build windows
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
// FdLimits not supported on Windows
|
||||
func FdLimits() string {
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// +build !linux
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
import "runtime"
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"log"
|
|
@ -14,7 +14,7 @@
|
|||
// +build 386 amd64 arm64 mips64 mips64le mips mipsle
|
||||
// +build linux
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
func charsToString(ca []int8) string {
|
||||
s := make([]byte, 0, len(ca))
|
|
@ -14,7 +14,7 @@
|
|||
// +build arm ppc64 ppc64le s390x
|
||||
// +build linux
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
func charsToString(ca []uint8) string {
|
||||
s := make([]byte, 0, len(ca))
|
|
@ -14,7 +14,7 @@
|
|||
// +build !windows
|
||||
// +build !openbsd
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"syscall"
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// +build openbsd
|
||||
|
||||
package main
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"syscall"
|
Loading…
Reference in New Issue