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 ¶
var (
// ProfileDir is the directory where the profile script is written.
ProfileDir = "/etc/profile.d"
)
Functions ¶
func NewWorker ¶
NewWorker starts an http server listening on an abstract domain socket which will be created with the specified name.
func WriteProfileFunctions ¶
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 Reporter PubSub Reporter MachineLock machinelock.Lock PrometheusGatherer prometheus.Gatherer Presence presence.Recorder Clock Clock LocalHub SimpleHub CentralHub StructuredHub Leases Leases }
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 Leases ¶
type Leases interface {
Snapshot() (raft.FSMSnapshot, error)
}
Leases provides the methods needed to expose the lease internals.
type Reporter ¶
type Reporter interface {
IntrospectionReport() string
}
Reporter provides a simple method that the introspection worker will output for the entity.
type SimpleHub ¶
type SimpleHub interface { Publish(topic string, data interface{}) <-chan struct{} Subscribe(topic string, handler func(string, interface{})) func() }
SimpleHub is a pubsub hub used for internal messaging.