Documentation ¶
Index ¶
Constants ¶
const IntrospectionSocketName = "introspection.socket"
IntrospectionSocketName is the name of the socket file inside the agent's directory used for introspection calls.
Variables ¶
This section is empty.
Functions ¶
func NewPrometheusRegistry ¶
func NewPrometheusRegistry() (*prometheus.Registry, error)
NewPrometheusRegistry returns a new prometheus.Registry with the Go and process metric collectors registered. This registry is exposed by the introspection abstract domain socket on all Linux agents.
func RegisterEngineMetrics ¶
func RegisterEngineMetrics(registry prometheus.Registerer, metrics prometheus.Collector, worker worker.Worker, sink engine.MetricSink) error
RegisterEngineMetrics registers the metrics sink on a prometheus registerer, ensuring that we cleanup when the worker has stopped.
func StartIntrospection ¶
func StartIntrospection(cfg IntrospectionConfig) error
StartIntrospection creates the introspection worker. It cannot and should not be in the engine itself as it reports on the engine, and other aspects of the runtime. If we put it in the engine, then it is mostly likely shut down in the times we need it most, which is when the agent is having problems shutting down. Here we effectively start the worker and tie its life to that of the engine that is returned.
Types ¶
type IntrospectionConfig ¶
type IntrospectionConfig struct { AgentDir string Engine *dependency.Engine StatePoolReporter introspection.Reporter PubSubReporter introspection.Reporter MachineLock machinelock.Lock PrometheusGatherer prometheus.Gatherer PresenceRecorder presence.Recorder Clock clock.Clock LocalHub introspection.SimpleHub CentralHub introspection.StructuredHub WorkerFunc func(config introspection.Config) (worker.Worker, error) }
IntrospectionConfig defines the various components that the introspection worker reports on or needs to start up.