Documentation ¶
Index ¶
- Variables
- type Datastore
- func (t *Datastore) DeleteTracepoint(tracepointID uuid.UUID) error
- func (t *Datastore) DeleteTracepointTTLs(ids []uuid.UUID) error
- func (t *Datastore) DeleteTracepointsForAgent(agentID uuid.UUID) error
- func (t *Datastore) GetTracepoint(tracepointID uuid.UUID) (*storepb.TracepointInfo, error)
- func (t *Datastore) GetTracepointStates(tracepointID uuid.UUID) ([]*storepb.AgentTracepointStatus, error)
- func (t *Datastore) GetTracepointTTLs() ([]uuid.UUID, []time.Time, error)
- func (t *Datastore) GetTracepoints() ([]*storepb.TracepointInfo, error)
- func (t *Datastore) GetTracepointsForIDs(ids []uuid.UUID) ([]*storepb.TracepointInfo, error)
- func (t *Datastore) GetTracepointsWithNames(tracepointNames []string) ([]*uuid.UUID, error)
- func (t *Datastore) SetTracepointTTL(tracepointID uuid.UUID, ttl time.Duration) error
- func (t *Datastore) SetTracepointWithName(tracepointName string, tracepointID uuid.UUID) error
- func (t *Datastore) UpdateTracepointState(state *storepb.AgentTracepointStatus) error
- func (t *Datastore) UpsertTracepoint(tracepointID uuid.UUID, tracepointInfo *storepb.TracepointInfo) error
- type Manager
- func (m *Manager) Close()
- func (m *Manager) CreateTracepoint(tracepointName string, tracepointDeployment *logicalpb.TracepointDeployment, ...) (*uuid.UUID, error)
- func (m *Manager) DeleteAgent(agentID uuid.UUID) error
- func (m *Manager) FilterAgentsBySelector(agents []*agentpb.Agent, selector *logicalpb.TracepointSelector) []*agentpb.Agent
- func (m *Manager) GetAllTracepoints() ([]*storepb.TracepointInfo, error)
- func (m *Manager) GetTracepointInfo(tracepointID uuid.UUID) (*storepb.TracepointInfo, error)
- func (m *Manager) GetTracepointStates(tracepointID uuid.UUID) ([]*storepb.AgentTracepointStatus, error)
- func (m *Manager) GetTracepointsForIDs(ids []uuid.UUID) ([]*storepb.TracepointInfo, error)
- func (m *Manager) RegisterTracepoint(agents []*agentpb.Agent, tracepointID uuid.UUID, ...) error
- func (m *Manager) RemoveTracepoints(names []string) error
- func (m *Manager) UpdateAgentTracepointStatus(tracepointID *uuidpb.UUID, agentID *uuidpb.UUID, state statuspb.LifeCycleState, ...) error
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTracepointAlreadyExists is produced if a tracepoint already exists with the given name // and does not have a matching schema. ErrTracepointAlreadyExists = errors.New("TracepointDeployment already exists") )
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore implements the TracepointStore interface on a given Datastore.
func NewDatastore ¶
func NewDatastore(ds datastore.MultiGetterSetterDeleterCloser) *Datastore
NewDatastore wraps the datastore in a tracepointstore
func (*Datastore) DeleteTracepoint ¶
DeleteTracepoint deletes the tracepoint from the store.
func (*Datastore) DeleteTracepointTTLs ¶
DeleteTracepointTTLs deletes the key in the datastore for the given tracepoint TTLs. This is done as a single transaction, so if any deletes fail, they all fail.
func (*Datastore) DeleteTracepointsForAgent ¶
DeleteTracepointsForAgent deletes the tracepoints for a given agent. Note this only purges the combo tracepointID+agentID keys. Said tracepoints might still be valid and deployed on other agents.
func (*Datastore) GetTracepoint ¶
GetTracepoint gets the tracepoint info from the store, if it exists.
func (*Datastore) GetTracepointStates ¶
func (t *Datastore) GetTracepointStates(tracepointID uuid.UUID) ([]*storepb.AgentTracepointStatus, error)
GetTracepointStates gets all the agentTracepoint states for the given tracepoint.
func (*Datastore) GetTracepointTTLs ¶
GetTracepointTTLs gets the tracepoints which still have existing TTLs.
func (*Datastore) GetTracepoints ¶
func (t *Datastore) GetTracepoints() ([]*storepb.TracepointInfo, error)
GetTracepoints gets all of the tracepoints in the store.
func (*Datastore) GetTracepointsForIDs ¶
GetTracepointsForIDs gets all of the tracepoints with the given it.ds.
func (*Datastore) GetTracepointsWithNames ¶
GetTracepointsWithNames gets which tracepoint is associated with the given name.
func (*Datastore) SetTracepointTTL ¶
SetTracepointTTL creates a key in the datastore with the given TTL. This represents the amount of time that the given tracepoint should be persisted before terminating.
func (*Datastore) SetTracepointWithName ¶
SetTracepointWithName associates the tracepoint with the given name with the one with the provided ID.
func (*Datastore) UpdateTracepointState ¶
func (t *Datastore) UpdateTracepointState(state *storepb.AgentTracepointStatus) error
UpdateTracepointState updates the agent tracepoint state in the store.
func (*Datastore) UpsertTracepoint ¶
func (t *Datastore) UpsertTracepoint(tracepointID uuid.UUID, tracepointInfo *storepb.TracepointInfo) error
UpsertTracepoint updates or creates a new tracepoint entry in the store.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the tracepoints deployed in the cluster.
func NewManager ¶
NewManager creates a new tracepoint manager.
func (*Manager) Close ¶
func (m *Manager) Close()
Close cleans up the goroutines created and renders this no longer useable.
func (*Manager) CreateTracepoint ¶
func (m *Manager) CreateTracepoint(tracepointName string, tracepointDeployment *logicalpb.TracepointDeployment, ttl time.Duration) (*uuid.UUID, error)
CreateTracepoint creates and stores info about the given tracepoint.
func (*Manager) DeleteAgent ¶
DeleteAgent deletes tracepoints on the given agent.
func (*Manager) FilterAgentsBySelector ¶
func (*Manager) GetAllTracepoints ¶
func (m *Manager) GetAllTracepoints() ([]*storepb.TracepointInfo, error)
GetAllTracepoints gets all the tracepoints currently tracked by the metadata service.
func (*Manager) GetTracepointInfo ¶
GetTracepointInfo gets the status for the tracepoint with the given ID.
func (*Manager) GetTracepointStates ¶
func (m *Manager) GetTracepointStates(tracepointID uuid.UUID) ([]*storepb.AgentTracepointStatus, error)
GetTracepointStates gets all the known agent states for the given tracepoint.
func (*Manager) GetTracepointsForIDs ¶
GetTracepointsForIDs gets all the tracepoint infos for the given ids.
func (*Manager) RegisterTracepoint ¶
func (m *Manager) RegisterTracepoint(agents []*agentpb.Agent, tracepointID uuid.UUID, tracepointDeployment *logicalpb.TracepointDeployment) error
RegisterTracepoint sends requests to the given agents to register the specified tracepoint. For each tracepoint program in this deployment, we look at the selectors and pick a list of agents that match those selectors. For that list of agents, we send out a tracepoint request with a new tracepointDeployment. If multiple programs may have the same list of allowed agents, we collapse them into one tracepoint deployment and send those in one request. Note: stirling current only supports one tracepoint per tracepoint deployment.
func (*Manager) RemoveTracepoints ¶
RemoveTracepoints starts the termination process for the tracepoints with the given names.
type Store ¶
type Store interface { UpsertTracepoint(uuid.UUID, *storepb.TracepointInfo) error GetTracepoint(uuid.UUID) (*storepb.TracepointInfo, error) GetTracepoints() ([]*storepb.TracepointInfo, error) UpdateTracepointState(*storepb.AgentTracepointStatus) error GetTracepointStates(uuid.UUID) ([]*storepb.AgentTracepointStatus, error) SetTracepointWithName(string, uuid.UUID) error GetTracepointsWithNames([]string) ([]*uuid.UUID, error) GetTracepointsForIDs([]uuid.UUID) ([]*storepb.TracepointInfo, error) SetTracepointTTL(uuid.UUID, time.Duration) error DeleteTracepointTTLs([]uuid.UUID) error DeleteTracepoint(uuid.UUID) error DeleteTracepointsForAgent(uuid.UUID) error GetTracepointTTLs() ([]uuid.UUID, []time.Time, error) }
Store is a datastore which can store, update, and retrieve information about tracepoints.