symbolizer

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReaderAtCloser

func NewReaderAtCloser(data []byte) interface {
	io.ReadCloser
	io.ReaderAt
}

Types

type Config

type Config struct {
	DebuginfodURL            string        `yaml:"debuginfod_url" category:"advanced"`
	MaxDebuginfodConcurrency int           `yaml:"max_debuginfod_concurrency" category:"advanced"`
	ResolveTimeout           time.Duration `yaml:"resolve_timeout" category:"advanced"`
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

type DebuginfodClient

type DebuginfodClient interface {
	FetchDebuginfo(ctx context.Context, buildID string) (io.ReadCloser, error)
}

type DebuginfodClientConfig

type DebuginfodClientConfig struct {
	BaseURL       string
	HTTPClient    *http.Client
	BackoffConfig backoff.Config
	UserAgent     string

	NotFoundCacheMaxItems int64
	NotFoundCacheTTL      time.Duration

	// BreakerFailureThreshold consecutive network-level failures open the
	// circuit breaker for BreakerOpenDuration. A threshold <= 0 disables
	// the breaker.
	BreakerFailureThreshold int
	BreakerOpenDuration     time.Duration

	// MaxConcurrentFetches bounds in-flight upstream fetches (the
	// politeness budget toward the debuginfod server).
	// <= 0 uses defaultMaxDebuginfodConcurrency.
	MaxConcurrentFetches int
}

DebuginfodClientConfig holds configuration for the debuginfod client.

type DebuginfodHTTPClient

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

DebuginfodHTTPClient implements the DebuginfodClient interface using HTTP.

func NewDebuginfodClient

func NewDebuginfodClient(logger log.Logger, baseURL string, metrics *metrics, limits Limits) (*DebuginfodHTTPClient, error)

func NewDebuginfodClientWithConfig

func NewDebuginfodClientWithConfig(logger log.Logger, cfg DebuginfodClientConfig, metrics *metrics, limits Limits) (*DebuginfodHTTPClient, error)

NewDebuginfodClientWithConfig creates a new client with the specified configuration.

func (*DebuginfodHTTPClient) FetchDebuginfo

func (c *DebuginfodHTTPClient) FetchDebuginfo(ctx context.Context, buildID string) (io.ReadCloser, error)

FetchDebuginfo fetches the debuginfo file for a specific build ID.

Concurrent callers for the same build ID share one fetch, detached from any single caller's cancellation. The error contract follows from that: a done caller gets its own context error without waiting for the shared fetch to finish, and every other error comes from the shared fetch — it may wrap a context error (e.g. the HTTP client's timeout) that says nothing about the caller's own context.

type ErrSymbolSizeBytesExceedsLimit

type ErrSymbolSizeBytesExceedsLimit struct {
	Limit int64
}

func (*ErrSymbolSizeBytesExceedsLimit) Error

type LidiaTableCacheEntry

type LidiaTableCacheEntry struct {
	Data []byte // Processed Lidia table data
}

LidiaTableCacheEntry represents a cached Lidia table with its binary layout information

type Limits

type Limits interface {
	SymbolizerMaxSymbolSizeBytes(tenantID string) int
}

type Resolver added in v2.2.0

type Resolver interface {
	Resolve(ctx context.Context, buildID, binaryName string, addrs []uint64) ([][]lidia.SourceInfoFrame, error)
}

Resolver resolves debug symbols for addresses within a single binary (identified by buildID). result[i] is aligned to addrs[i]; a nil/empty slice at index i means address i could not be resolved. A non-nil error is returned only when the caller's own ctx is done (context.Canceled or context.DeadlineExceeded), in which case result is nil; any other failure degrades to unresolved slots. A buildID that is empty or fails validation resolves nothing: every result slot is nil.

type Symbolizer

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

func New

func New(logger log.Logger, cfg Config, reg prometheus.Registerer, storageBucket objstore.Bucket, limits Limits) (*Symbolizer, error)

func (*Symbolizer) Resolve added in v2.2.0

func (s *Symbolizer) Resolve(ctx context.Context, buildID, binaryName string, addrs []uint64) ([][]lidia.SourceInfoFrame, error)

Resolve implements Resolver.

func (*Symbolizer) ResolveConcurrency added in v2.3.0

func (s *Symbolizer) ResolveConcurrency() int

ResolveConcurrency returns the maximum number of concurrent Resolve calls (or debuginfod fetches) this symbolizer allows, normalizing a non-positive configured value to defaultMaxDebuginfodConcurrency.

func (*Symbolizer) ResolveTimeout added in v2.3.0

func (s *Symbolizer) ResolveTimeout() time.Duration

ResolveTimeout bounds resolving a single binary's unresolved addresses, normalizing a non-positive configured value to defaultResolveTimeout.

func (*Symbolizer) SymbolizePprof

func (s *Symbolizer) SymbolizePprof(ctx context.Context, profile *googlev1.Profile) error

Jump to

Keyboard shortcuts

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