reporter

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDWARFData

func HasDWARFData(f *pfelf.File) bool

HasDWARFData is a copy of pfelf.HasDWARFData, but for the libpf.File interface.

Types

type Config

type Config struct {
	// Version defines the version of the agent.
	Version string
	// IntakeURL defines the URL of profiling intake.
	IntakeURL string
	// ExecutablesCacheElements defines item capacity of the executables cache.
	ExecutablesCacheElements uint32
	// FramesCacheElements defines the item capacity of the frames cache.
	FramesCacheElements uint32
	// ProcessesCacheElements defines the item capacity of the processes cache.
	ProcessesCacheElements uint32
	// samplesPerSecond defines the number of samples per second.
	SamplesPerSecond int
	// ReportInterval defines the interval at which the agent reports data to the collection agent.
	ReportInterval time.Duration
	// PprofPrefix defines a file where the agent should dump pprof CPU profile.
	PprofPrefix string
	// Tags is a list of tags to be sent to the collection agent.
	Tags Tags
	// Whether to include timestamps on samples for the timeline feature
	Timeline bool
	// API key for agentless mode
	APIKey string
	// SymbolUploaderConfig defines the configuration for the symbol uploader.
	SymbolUploaderConfig SymbolUploaderConfig
}

type DatadogReporter

type DatadogReporter struct {
	// contains filtered or unexported fields
}

DatadogReporter receives and transforms information to be OTLP/profiles compliant.

func NewDatadog added in v0.2.1

func NewDatadog(cfg *Config, p containermetadata.Provider) (*DatadogReporter, error)

func (*DatadogReporter) ExecutableKnown added in v0.2.1

func (r *DatadogReporter) ExecutableKnown(fileID libpf.FileID) bool

ExecutableKnown returns true if the metadata of the Executable specified by fileID is cached in the reporter.

func (*DatadogReporter) ExecutableMetadata

func (r *DatadogReporter) ExecutableMetadata(args *reporter.ExecutableMetadataArgs)

ExecutableMetadata accepts a fileID with the corresponding filename and caches this information.

func (*DatadogReporter) FrameKnown added in v0.2.1

func (r *DatadogReporter) FrameKnown(frameID libpf.FrameID) bool

FrameKnown returns true if the metadata of the Frame specified by frameID is cached in the reporter.

func (*DatadogReporter) FrameMetadata

func (r *DatadogReporter) FrameMetadata(args *reporter.FrameMetadataArgs)

FrameMetadata accepts metadata associated with a frame and caches this information.

func (*DatadogReporter) GetMetrics

func (r *DatadogReporter) GetMetrics() reporter.Metrics

GetMetrics returns internal metrics of DatadogReporter.

func (*DatadogReporter) ReportCountForTrace

func (r *DatadogReporter) ReportCountForTrace(_ libpf.TraceHash, _ uint16, _ *reporter.TraceEventMeta)

ReportCountForTrace is a NOP for DatadogReporter.

func (*DatadogReporter) ReportFramesForTrace

func (r *DatadogReporter) ReportFramesForTrace(_ *libpf.Trace)

ReportFramesForTrace is a NOP for DatadogReporter.

func (*DatadogReporter) ReportHostMetadata

func (r *DatadogReporter) ReportHostMetadata(_ map[string]string)

ReportHostMetadata is a NOP for DatadogReporter.

func (*DatadogReporter) ReportHostMetadataBlocking

func (r *DatadogReporter) ReportHostMetadataBlocking(_ context.Context,
	_ map[string]string, _ int, _ time.Duration) error

ReportHostMetadataBlocking is a NOP for DatadogReporter.

func (*DatadogReporter) ReportMetrics

func (r *DatadogReporter) ReportMetrics(_ uint32, _ []uint32, _ []int64)

ReportMetrics is a NOP for DatadogReporter.

func (*DatadogReporter) ReportTraceEvent

func (r *DatadogReporter) ReportTraceEvent(trace *libpf.Trace, meta *reporter.TraceEventMeta)

ReportTraceEvent enqueues reported trace events for the Datadog reporter.

func (*DatadogReporter) Start added in v0.2.1

func (r *DatadogReporter) Start(mainCtx context.Context) error

Start sets up and manages the reporting connection to the Datadog Backend.

func (*DatadogReporter) Stop

func (r *DatadogReporter) Stop()

Stop triggers a graceful shutdown of DatadogReporter.

func (*DatadogReporter) SupportsReportTraceEvent

func (r *DatadogReporter) SupportsReportTraceEvent() bool

SupportsReportTraceEvent returns true if the reporter supports reporting trace events via ReportTraceEvent().

type DatadogSymbolQuerier

type DatadogSymbolQuerier struct {
	// contains filtered or unexported fields
}

func NewDatadogSymbolQuerier

func NewDatadogSymbolQuerier(ddSite, ddAPIKey, ddAPPKey string) (*DatadogSymbolQuerier, error)

func (*DatadogSymbolQuerier) QuerySymbols

func (d *DatadogSymbolQuerier) QuerySymbols(ctx context.Context, buildIDs []string,
	arch string) ([]SymbolFile, error)

type DatadogSymbolUploader

type DatadogSymbolUploader struct {
	// contains filtered or unexported fields
}

func NewDatadogSymbolUploader

func NewDatadogSymbolUploader(cfg SymbolUploaderConfig) (*DatadogSymbolUploader, error)

func (*DatadogSymbolUploader) GetExistingSymbolsOnBackend

func (d *DatadogSymbolUploader) GetExistingSymbolsOnBackend(ctx context.Context,
	e *executableMetadata) (SymbolSource, error)

func (*DatadogSymbolUploader) Run

func (*DatadogSymbolUploader) UploadSymbols

func (d *DatadogSymbolUploader) UploadSymbols(fileID libpf.FileID, filePath, buildID string,
	opener process.FileOpener)

type SymbolFile

type SymbolFile struct {
	ID           string `json:"id" jsonapi:"primary,symbols-query-response"`
	BuildID      string `json:"buildId" jsonapi:"attribute"`
	SymbolSource string `json:"symbolSource" jsonapi:"attribute"`
	BuildIDType  string `json:"buildIdType" jsonapi:"attribute"`
}

type SymbolSource

type SymbolSource int64
const (
	None SymbolSource = iota
	DynamicSymbolTable
	SymbolTable
	DebugInfo
)

func NewSymbolSource

func NewSymbolSource(s string) (SymbolSource, error)

func (SymbolSource) String

func (s SymbolSource) String() string

type SymbolUploaderConfig

type SymbolUploaderConfig struct {
	// Enabled defines whether the agent should upload debug symbols to the backend.
	Enabled bool
	// UploadDynamicSymbols defines whether the agent should upload dynamic symbols to the backend.
	UploadDynamicSymbols bool
	// DryRun defines whether the agent should upload debug symbols to the backend in dry-run mode.
	DryRun bool
	// DataDog API key
	APIKey string
	// DataDog APP key
	APPKey string
	// Site is the site to upload symbols to.
	Site string
	// Version is the version of the profiler.
	Version string
}

type SymbolsQueryRequest

type SymbolsQueryRequest struct {
	ID       string   `jsonapi:"primary,symbols-query-request"`
	BuildIDs []string `json:"buildIds" jsonapi:"attribute" validate:"required"`
	Arch     string   `json:"arch" jsonapi:"attribute" validate:"required"`
}

type Tag

type Tag struct {
	Key   string
	Value string
}

func MakeTag

func MakeTag(key, value string) Tag

type Tags

type Tags []Tag

func (Tags) String

func (t Tags) String() string

Jump to

Keyboard shortcuts

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