Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
 - func DumpPacketCounters(logf func(f string, args ...interface{}), interfaces map[string]interfaceInfo, ...)
 - func GetErrorType(err error) api_schema.ApidumpErrorType
 - func GetErrorTypeWithDefault(err error, def api_schema.ApidumpErrorType) api_schema.ApidumpErrorType
 - func Run(args Args) error
 - type ApidumpError
 - type Args
 - type DaemonsetArgs
 - type Summary
 
Constants ¶
This section is empty.
Variables ¶
var ProcessSignalErr = errors.New("process received exit signal")
    Functions ¶
func DumpPacketCounters ¶
func DumpPacketCounters(logf func(f string, args ...interface{}), interfaces map[string]interfaceInfo, matchedSummary *trace.PacketCounter, unmatchedSummary *trace.PacketCounter, showInterface bool)
DumpPacketCounters prints the accumulated packet counts per interface and per port, to the logging function specified in the first argument. The "interfaces" argument should be the map keyed by interface names (as created in the apidump.Run function); all we really need are those names.
func GetErrorType ¶
func GetErrorType(err error) api_schema.ApidumpErrorType
Returns the error type if err contains an ApidumpError, or ApidumpError_Other otherwise.
func GetErrorTypeWithDefault ¶
func GetErrorTypeWithDefault(err error, def api_schema.ApidumpErrorType) api_schema.ApidumpErrorType
Returns the error type if err contains an ApidumpError, or def otherwise.
Types ¶
type ApidumpError ¶
type ApidumpError struct {
	// contains filtered or unexported fields
}
    func NewApidumpError ¶
func NewApidumpError(errType api_schema.ApidumpErrorType, msg string) ApidumpError
func NewApidumpErrorf ¶
func NewApidumpErrorf(errType api_schema.ApidumpErrorType, format string, args ...interface{}) ApidumpError
func (ApidumpError) Error ¶
func (e ApidumpError) Error() string
type Args ¶
type Args struct {
	// Required args
	ClientID akid.ClientID
	Domain   string
	// If both LocalPath and AkitaURI are set, data is teed to both local traces
	// and backend trace.
	// If unset, defaults to a random spec name on Akita Cloud.
	Out location.Location
	// Args used to using agent with Postman
	PostmanCollectionID string
	// ServiceID parsed from projectID
	ServiceID akid.ServiceID
	Interfaces     []string
	Filter         string
	Tags           map[tags.Key]string
	PathExclusions []string
	HostExclusions []string
	PathAllowlist  []string
	HostAllowlist  []string
	// Rate-limiting parameters -- only one should be set to a non-default value.
	SampleRate         float64
	WitnessesPerMinute float64
	// If set, apidump will run the command in a subshell and terminate
	// automatically when the subcommand terminates.
	//
	// apidump will pipe stdout and stderr from the command. If the command stops
	// with non-zero exit code, apidump will also exit with the same exit code.
	ExecCommand string
	// Username to run ExecCommand as. If not set, defaults to the current user.
	ExecCommandUser string
	Plugins []plugin.AkitaPlugin
	// How often to rotate learn sessions; set to zero to disable rotation.
	LearnSessionLifetime time.Duration
	// Periodically report telemetry every N seconds thereafter
	TelemetryInterval int
	// Periodically poll /proc fs for agent resource usage every N seconds.
	ProcFSPollingInterval int
	// Whether to report TCP connections and TLS handshakes.
	CollectTCPAndTLSReports bool
	// Parse TLS handshake messages (even if not reported)
	// Invariant: this is true if CollectTCPAndTLSReports is true
	ParseTLSHandshakes bool
	// The maximum witness size to upload. Anything larger is dropped.
	MaxWitnessSize_bytes int
	// Whether to run the command with additional functionality to support the Docker Extension
	DockerExtensionMode bool
	// The port to be used by the Docker Extension for health checks
	HealthCheckPort int
	// Whether to enable repro mode and include request/response payloads when uploading witnesses.
	ReproMode bool
	// Whether to drop traffic to/from nginx
	DropNginxTraffic bool
	DaemonsetArgs optionals.Optional[DaemonsetArgs]
}
    type DaemonsetArgs ¶ added in v0.34.0
type DaemonsetArgs struct {
	TargetNetworkNamespaceOpt string
	StopChan                  <-chan error `json:"-"`
	APIKey                    string
	Environment               string
	TraceTags                 tags.SingletonTags
}
    Args for running apidump as daemonset in Kubernetes
type Summary ¶
type Summary struct {
	// Indicates whether this summary includes information about packets that did
	// not meet the BPF filters specified by the user.
	CapturingNegation bool
	Interfaces      map[string]interfaceInfo
	NegationFilters map[string]string
	NumUserFilters  int
	// Values that change over the course of apidump are pointers.
	FilterSummary    *trace.PacketCounter
	PrefilterSummary *trace.PacketCounter
	NegationSummary  *trace.PacketCounter
}
    Captures apidump progress.
func NewSummary ¶
func NewSummary( capturingNegation bool, interfaces map[string]interfaceInfo, negationFilters map[string]string, numUserFilters int, filterSummary *trace.PacketCounter, prefilterSummary *trace.PacketCounter, negationSummary *trace.PacketCounter, ) *Summary
func (*Summary) PrintPacketCountHighlights ¶
func (s *Summary) PrintPacketCountHighlights()
Summarize the top sources of traffic seen in a log-friendly format. This appears before PrintWarnings, and should highlight the raw data.
func (*Summary) PrintPacketCounts ¶
func (s *Summary) PrintPacketCounts()
Dumps packet counters for packets captured and sent to the Akita backend. If the debug flag is set, also prints packets taht were captured but not sent to the backend.
func (*Summary) PrintWarnings ¶
func (s *Summary) PrintWarnings()
Prints warnings based on packet capture behavior, such as not capturing any packets, capturing packets but failing to parse them, etc.