tracepoint

package
v0.0.0-...-8540621 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

NewDatastore wraps the datastore in a tracepointstore

func (*Datastore) DeleteTracepoint

func (t *Datastore) DeleteTracepoint(tracepointID uuid.UUID) error

DeleteTracepoint deletes the tracepoint from the store.

func (*Datastore) DeleteTracepointTTLs

func (t *Datastore) DeleteTracepointTTLs(ids []uuid.UUID) error

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

func (t *Datastore) DeleteTracepointsForAgent(agentID uuid.UUID) error

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

func (t *Datastore) GetTracepoint(tracepointID uuid.UUID) (*storepb.TracepointInfo, error)

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

func (t *Datastore) GetTracepointTTLs() ([]uuid.UUID, []time.Time, error)

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

func (t *Datastore) GetTracepointsForIDs(ids []uuid.UUID) ([]*storepb.TracepointInfo, error)

GetTracepointsForIDs gets all of the tracepoints with the given it.ds.

func (*Datastore) GetTracepointsWithNames

func (t *Datastore) GetTracepointsWithNames(tracepointNames []string) ([]*uuid.UUID, error)

GetTracepointsWithNames gets which tracepoint is associated with the given name.

func (*Datastore) SetTracepointTTL

func (t *Datastore) SetTracepointTTL(tracepointID uuid.UUID, ttl time.Duration) error

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

func (t *Datastore) SetTracepointWithName(tracepointName string, tracepointID uuid.UUID) error

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

func NewManager(ts Store, agtMgr agentMessenger, ttlReaperDuration time.Duration) *Manager

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

func (m *Manager) DeleteAgent(agentID uuid.UUID) error

DeleteAgent deletes tracepoints on the given agent.

func (*Manager) FilterAgentsBySelector

func (m *Manager) FilterAgentsBySelector(agents []*agentpb.Agent, selector *logicalpb.TracepointSelector) []*agentpb.Agent

func (*Manager) GetAllTracepoints

func (m *Manager) GetAllTracepoints() ([]*storepb.TracepointInfo, error)

GetAllTracepoints gets all the tracepoints currently tracked by the metadata service.

func (*Manager) GetTracepointInfo

func (m *Manager) GetTracepointInfo(tracepointID uuid.UUID) (*storepb.TracepointInfo, error)

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

func (m *Manager) GetTracepointsForIDs(ids []uuid.UUID) ([]*storepb.TracepointInfo, error)

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

func (m *Manager) RemoveTracepoints(names []string) error

RemoveTracepoints starts the termination process for the tracepoints with the given names.

func (*Manager) UpdateAgentTracepointStatus

func (m *Manager) UpdateAgentTracepointStatus(tracepointID *uuidpb.UUID, agentID *uuidpb.UUID, state statuspb.LifeCycleState, status *statuspb.Status) error

UpdateAgentTracepointStatus updates the tracepoint info with the new agent tracepoint status.

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.

Directories

Path Synopsis
Package mock_tracepoint is a generated GoMock package.
Package mock_tracepoint is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL