serviceability

package
v0.0.0-...-1f32fc6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 109 modules, 624 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BehaviorOnPanic

func BehaviorOnPanic(modeString string, productVersion version.Info) func()

BehaviorOnPanic is a helper for setting the crash mode of OpenShift when a panic is caught. It returns a function that should be the defer handler for the caller.

func InitLogrus

func InitLogrus(level string)

InitLogrus initializes logrus by setting a loglevel for it.

func InitLogrusFromKlog

func InitLogrusFromKlog()

InitLogrusFromKlog sets the logrus trace level based on the klog trace level.

func StartProfiler

func StartProfiler()

StartProfiler starts the golang profiler on a port if `web` is specified. It uses the "standard" openshift env vars

Types

type Stop

type Stop interface {
	Stop()
}

Stop is a function to defer in your main call to provide profile info.

func Profile

func Profile(mode string) Stop

Profile returns an interface to defer for a profile: `defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()` is common. Suffixing the mode with `-tmp` will have the profiler write the run to a temporary directory with a unique name, which is useful when running the same command multiple times.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL