Documentation ¶
Overview ¶
Package introspection defines the worker that can report internal agent state through the use of a machine local socket.
The most interesting endpoints at this stage are: * `/debug/pprof/goroutine?debug=1`
- prints out all the goroutines in the agent
* `/debug/pprof/heap?debug=1`
- prints out the heap profile
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWorker ¶
NewWorker starts an http server listening on an abstract domain socket which will be created with the specified name.
func RegisterHTTPHandlers ¶
func RegisterHTTPHandlers( sources ReportSources, handle func(path string, h http.Handler), )
AddHandlers calls the given function with http.Handlers that serve agent introspection requests. The function will be called with a path; the function may alter the path as it sees fit.
func WriteProfileFunctions ¶
func WriteProfileFunctions() error
WriteProfileFunctions writes the bashFuncs below to a file in the /etc/profile.d directory so all bash terminals can easily access the introspection worker.
Types ¶
type Config ¶
type Config struct { SocketName string DepEngine DepEngineReporter StatePool IntrospectionReporter PrometheusGatherer prometheus.Gatherer }
Config describes the arguments required to create the introspection worker.
type DepEngineReporter ¶
type DepEngineReporter interface { // Report returns a map describing the state of the receiver. It is expected // to be goroutine-safe. Report() map[string]interface{} }
DepEngineReporter provides insight into the running dependency engine of the agent.
type IntrospectionReporter ¶
type IntrospectionReporter interface {
IntrospectionReport() string
}
IntrospectionReporter provides a simple method that the introspection worker will output for the entity.
type ReportSources ¶
type ReportSources struct { DependencyEngine DepEngineReporter StatePool IntrospectionReporter PrometheusGatherer prometheus.Gatherer }
ReportSources are the various information sources that are exposed through the introspection facility.