reporter

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 38 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceNameEnvVars = []string{"DD_SERVICE", "OTEL_SERVICE_NAME"}

Functions

func CheckObjcopyZstdSupport added in v0.2.3

func CheckObjcopyZstdSupport() bool

func CopySymbols added in v0.2.2

func CopySymbols(ctx context.Context, inputPath, outputPath string, goPCLnTabInfo *pclntab.GoPCLnTabInfo,
	sectionsToKeep []symbol.SectionInfo, compressDebugSections bool) error

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
	// 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
	// EnableSplitByService defines whether the agent should split profiles by service.
	EnableSplitByService bool
	// SplitServiceSuffix defines the suffix to add to service name in profiles when split-by-service is enabled.
	SplitServiceSuffix string
	// HostServiceName defines the service name to use in profiles (in non-split-by-service mode).
	HostServiceName 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) 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) ReportTraceEvent

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

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.

type DatadogSymbolUploader

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

func NewDatadogSymbolUploader

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

func (*DatadogSymbolUploader) Start added in v0.2.2

func (d *DatadogSymbolUploader) Start(ctx context.Context)

func (*DatadogSymbolUploader) Stop added in v0.2.2

func (d *DatadogSymbolUploader) Stop()

func (*DatadogSymbolUploader) UploadSymbols

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

type ElfWithBackendSources added in v0.2.2

type ElfWithBackendSources struct {
	*symbol.Elf
	BackendSymbolSources []SymbolQueryResult
}

func ExecuteSymbolQueryBatch added in v0.2.2

func ExecuteSymbolQueryBatch(ctx context.Context, batch SymbolQueryBatch, queriers []SymbolQuerier) []ElfWithBackendSources

type SymbolEndpoint added in v0.2.2

type SymbolEndpoint struct {
	Site   string `json:"site"`
	APIKey string `json:"api_key"`
	AppKey string `json:"app_key"`
}

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 SymbolQuerier added in v0.2.2

type SymbolQuerier interface {
	QuerySymbols(ctx context.Context, buildIDs []string, arch string) ([]SymbolFile, error)
}

func NewDatadogSymbolQuerier

func NewDatadogSymbolQuerier(ddSite, ddAPIKey, ddAPPKey string) (SymbolQuerier, error)

type SymbolQueryBatch added in v0.2.2

type SymbolQueryBatch []*symbol.Elf

type SymbolQueryResult added in v0.2.2

type SymbolQueryResult struct {
	SymbolSource symbol.Source
	Err          error
}

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
	// UploadGoPCLnTab defines whether the agent should upload GoPCLnTab section for Go binaries to the backend.
	UploadGoPCLnTab bool
	// UseHTTP2 defines whether the agent should use HTTP/2 when uploading symbols.
	UseHTTP2 bool
	// SymbolQueryInterval defines the interval at which the agent should query the backend for symbols. A value of 0 disables batching.
	SymbolQueryInterval time.Duration
	// DisableDebugSectionCompression defines whether the uploader should disable debug section compression whatever objcopy supports.
	DisableDebugSectionCompression bool
	// DryRun defines whether the agent should upload debug symbols to the backend in dry-run mode.
	DryRun bool
	// Sites to upload symbols to.
	SymbolEndpoints []SymbolEndpoint
	// 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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