Documentation ¶
Index ¶
- func BpfVerifierLogSetting() (level uint32, size int)
- func CacheDirectory() string
- func CollectionAgentAddr() string
- func ConfigurationFile() string
- func DisableTLS() bool
- func GenerateNewHostIDIfNecessary() error
- func HostID() uint64
- func Hostname() string
- func IPAddress() string
- func KernelVersion() string
- func MapScaleFactor() uint8
- func MaxElementsPerInterval() uint32
- func NoKernelVersionCheck() bool
- func PresentCPUCores() uint16
- func ProbabilisticThreshold() uint
- func ProjectID() uint32
- func RunsOnAWS() bool
- func RunsOnAzure() bool
- func RunsOnGCP() bool
- func SamplesPerSecond() uint16
- func SecretToken() string
- func SetConfiguration(conf *Config) error
- func StartTime() time.Time
- func Tags() string
- func TraceCacheEntries() uint32
- func Tracers() string
- func UploadSymbols() bool
- func ValidatedTags() string
- func Verbose() bool
- type AzureInstanceMetadata
- type Config
- type EnvironmentType
- type IntervalsAndTimers
- type Times
- func (t *Times) GRPCAuthErrorDelay() time.Duration
- func (t *Times) GRPCConnectionTimeout() time.Duration
- func (t *Times) GRPCOperationTimeout() time.Duration
- func (t *Times) GRPCStartupBackoffTime() time.Duration
- func (t *Times) MonitorInterval() time.Duration
- func (t *Times) PIDCleanupInterval() time.Duration
- func (t *Times) ProbabilisticInterval() time.Duration
- func (t *Times) ReportInterval() time.Duration
- func (t *Times) ReportMetricsInterval() time.Duration
- func (t *Times) TracePollInterval() time.Duration
- type TracerType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BpfVerifierLogSetting ¶
BpfVerifierLogSetting returns the eBPF verifier log settings.
func CollectionAgentAddr ¶
func CollectionAgentAddr() string
Collection agent address in host:port format
func ConfigurationFile ¶
func ConfigurationFile() string
Path to profiling agent's configuration file
func GenerateNewHostIDIfNecessary ¶
func GenerateNewHostIDIfNecessary() error
GenerateHostID generates and sets the unique hostID
func HostID ¶
func HostID() uint64
HostID returns the hostID of the running agent. The host ID is calculated by calling GenerateNewHostIDIfNecessary().
func IPAddress ¶
func IPAddress() string
IP address of the interface through which the agent traffic is routed
func KernelVersion ¶
func KernelVersion() string
Kernel release (uname -r) of the machine that is running the agent
func MaxElementsPerInterval ¶
func MaxElementsPerInterval() uint32
MaxElementsPerInterval returns the maximum of possible elements reported per interval based on the number of cores, samples per second and monitor interval.
func NoKernelVersionCheck ¶
func NoKernelVersionCheck() bool
Indicates if kernel version checking for eBPF support is disabled
func ProbabilisticThreshold ¶
func ProbabilisticThreshold() uint
Threshold for probabilistic profiling
func SamplesPerSecond ¶
func SamplesPerSecond() uint16
SamplesPerSecond returns the configured samples per second.
func SecretToken ¶
func SecretToken() string
SecretToken returns the secretToken associated with the project
func SetConfiguration ¶
func TraceCacheEntries ¶
func TraceCacheEntries() uint32
TraceCacheEntries defines the maximum number of elements for the caches in tracehandler.
The caches in tracehandler have a size-"processing overhead" trade-off: Every cache miss will trigger additional processing for that trace in userspace (Go). For most maps, we use maxElementsPerInterval as a base sizing factor. For the tracehandler caches, we also multiply with traceCacheIntervals. For typical/small values of maxElementsPerInterval, this can lead to non-optimal map sizing (reduced cache_hit:cache_miss ratio and increased processing overhead). Simply increasing traceCacheIntervals is problematic when maxElementsPerInterval is large (e.g. too many CPU cores present) as we end up using too much memory. A minimum size is therefore used here. Also see: https://github.com/elastic/otel-profiling-agent/pull/2120#issuecomment-1043024813
func UploadSymbols ¶
func UploadSymbols() bool
Indicates whether automatic uploading of symbols is enabled
Types ¶
type AzureInstanceMetadata ¶
type AzureInstanceMetadata struct { Location string `json:"location"` Name string `json:"name"` SubscriptionID string `json:"subscriptionId"` Tags string `json:"tags"` Version string `json:"version"` VMID string `json:"vmId"` Zone string `json:"zone"` }
AzureInstanceMetadata as provided by https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service It is needed to decode the json encoded return by Azure.
type Config ¶
type Config struct { EnvironmentType string MachineID string SecretToken string Tags string ValidatedTags string CollectionAgentAddr string ConfigurationFile string Tracers string CacheDirectory string BpfVerifierLogSize int BpfVerifierLogLevel uint MonitorInterval time.Duration TracePollInterval time.Duration ReportInterval time.Duration ProjectID uint32 SamplesPerSecond uint16 PresentCPUCores uint16 DisableTLS bool UploadSymbols bool NoKernelVersionCheck bool TraceCacheIntervals uint8 Verbose bool MapScaleFactor uint8 StartTime time.Time ProbabilisticInterval time.Duration ProbabilisticThreshold uint // Bits of hostmetadata that we save in config so that they can be // conveniently accessed globally in the agent. IPAddress string Hostname string KernelVersion string }
Config is the structure to pass the configuration into host-agent.
type EnvironmentType ¶
type EnvironmentType uint8
EnvironmentType indicates the environment, the agent is running on.
func (EnvironmentType) String ¶
func (e EnvironmentType) String() string
type IntervalsAndTimers ¶
type IntervalsAndTimers interface { // MonitorInterval defines the interval for PID event monitoring and metric collection. MonitorInterval() time.Duration // TracePollInterval defines the interval at which we read the trace perf event buffer. TracePollInterval() time.Duration // ReportInterval defines the interval at which collected data is sent to collection agent. ReportInterval() time.Duration // ReportMetricsInterval defines the interval at which collected metrics are sent // to collection agent. ReportMetricsInterval() time.Duration // GRPCConnectionTimeout defines the timeout for each established gRPC connection. GRPCConnectionTimeout() time.Duration // GRPCOperationTimeout defines the timeout for each gRPC operation. GRPCOperationTimeout() time.Duration // GRPCStartupBackoffTime defines the time between failed gRPC requests during startup // phase. GRPCStartupBackoffTime() time.Duration // GRPCAuthErrorDelay defines the delay before triggering a global process exit after a // gRPC auth error. GRPCAuthErrorDelay() time.Duration // PIDCleanupInterval defines the interval at which monitored PIDs are checked for // liveness and no longer alive PIDs are cleaned up. PIDCleanupInterval() time.Duration // ProbabilisticInterval defines the interval for which probabilistic profiling will // be enabled or disabled. ProbabilisticInterval() time.Duration }
IntervalsAndTimers is a meta interface that exists purely to document its functionality.
type Times ¶
type Times struct {
// contains filtered or unexported fields
}
Times hold all the intervals and timeouts that are used across the host agent in a central place and comes with Getters to read them.
func (*Times) GRPCAuthErrorDelay ¶
func (*Times) GRPCConnectionTimeout ¶
func (*Times) GRPCOperationTimeout ¶
func (*Times) GRPCStartupBackoffTime ¶
func (*Times) MonitorInterval ¶
func (*Times) PIDCleanupInterval ¶
func (*Times) ProbabilisticInterval ¶
func (*Times) ReportInterval ¶
func (*Times) ReportMetricsInterval ¶
func (*Times) TracePollInterval ¶
type TracerType ¶
type TracerType int
TracerType values identify tracers, such as the native code tracer, or PHP tracer
const ( PerlTracer TracerType = iota PHPTracer PythonTracer HotspotTracer RubyTracer V8Tracer // MaxTracers indicates the max. number of different tracers MaxTracers )
func AllTracers ¶
func AllTracers() []TracerType
AllTracers returns a slice containing all supported tracers.
func (TracerType) GetString ¶
func (t TracerType) GetString() string
GetString converts the tracer type t to its related string value.