Documentation ¶
Index ¶
- func Main()
- type MetricsCounters
- type ProcessInfoCache
- type Sensor
- func (s *Sensor) NewEvent() *api.TelemetryEvent
- func (s *Sensor) NewEventFromContainer(containerID string) *api.TelemetryEvent
- func (s *Sensor) NewEventFromSample(sample *perf.SampleRecord, data perf.TraceEventSampleData) *api.TelemetryEvent
- func (s *Sensor) NewSubscription(sub *api.Subscription) (*stream.Stream, error)
- func (s *Sensor) Start() error
- func (s *Sensor) Stop()
- type TelemetryService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MetricsCounters ¶
type MetricsCounters struct { // Number of events created during the sample period Events uint64 // Number of subscriptions Subscriptions int32 }
MetricsCounters is used for tracking metrics information in the sensor
type ProcessInfoCache ¶
type ProcessInfoCache struct {
// contains filtered or unexported fields
}
ProcessInfoCache is an object that caches process information. It is maintained automatically via an existing sensor object.
func NewProcessInfoCache ¶
func NewProcessInfoCache(sensor *Sensor) ProcessInfoCache
NewProcessInfoCache creates a new process information cache object. An existing sensor object is required in order for the process info cache to able to install its probes to monitor the system to maintain the cache.
func (*ProcessInfoCache) ProcessCommandLine ¶
func (pc *ProcessInfoCache) ProcessCommandLine(pid int) ([]string, bool)
ProcessCommandLine returns the command-line for a process. The command-line is constructed from argv passed to execve(), but is limited to a fixed number of elements of argv; therefore, it may not be complete.
func (*ProcessInfoCache) ProcessContainerID ¶
func (pc *ProcessInfoCache) ProcessContainerID(pid int) (string, bool)
ProcessContainerID returns the container ID that the process indicated by the given host PID.
type Sensor ¶
type Sensor struct { // Unique Id for this sensor. Sensor Ids are ephemeral. ID string // Metrics counters for this sensor Metrics MetricsCounters // contains filtered or unexported fields }
Sensor represents the state of a sensor instance.
func (*Sensor) NewEvent ¶
func (s *Sensor) NewEvent() *api.TelemetryEvent
NewEvent creates a new API Event instance with common sensor-specific fields correctly populated.
func (*Sensor) NewEventFromContainer ¶
func (s *Sensor) NewEventFromContainer(containerID string) *api.TelemetryEvent
NewEventFromContainer creates a new API Event instance using a specific container ID.
func (*Sensor) NewEventFromSample ¶
func (s *Sensor) NewEventFromSample(sample *perf.SampleRecord, data perf.TraceEventSampleData) *api.TelemetryEvent
NewEventFromSample creates a new API Event instance using perf_event sample information.
func (*Sensor) NewSubscription ¶
NewSubscription creates a new telemetry subscription from the given api.Subscription descriptor. NewSubscription returns a stream.Stream of api.Events matching the specified filters. Closing the Stream cancels the subscription.
type TelemetryService ¶
type TelemetryService struct {
// contains filtered or unexported fields
}
TelemetryService is a service that can be used with the ServiceManager to process telemetry subscription requests and stream the resulting telemetry events.
func NewTelemetryService ¶
func NewTelemetryService(sensor *Sensor, address string) *TelemetryService
NewTelemetryService creates a new TelemetryService instance that can be used with a ServiceManager instance.
func (*TelemetryService) Name ¶
func (ts *TelemetryService) Name() string
Name returns the human-readable name of the TelemetryService.
func (*TelemetryService) Serve ¶
func (ts *TelemetryService) Serve() error
Serve is the main entrypoint for the TelemetryService. It is normally called by the ServiceManager. It will service requests indefinitely from the calling Goroutine.
func (*TelemetryService) Stop ¶
func (ts *TelemetryService) Stop()
Stop will stop a running TelemetryService.