profilingcfg

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderPyroscope represents Grafana Pyroscope.
	ProviderPyroscope = "pyroscope"
	// ProviderPprof represents Go-native pprof HTTP server.
	ProviderPprof = "pprof"
)

Variables

View Source
var (
	// ProfilingConfigProviders is a Wire provider set for profiling.
	ProfilingConfigProviders = wire.NewSet(
		ProvideProfilingProviderWire,
	)
)

Functions

func ProvideProfilingProviderWire

func ProvideProfilingProviderWire(ctx context.Context, logger logging.Logger, c *Config) (profiling.Provider, error)

ProvideProfilingProviderWire provides a profiling provider from config.

func RegisterProfilingProvider

func RegisterProfilingProvider(i do.Injector)

RegisterProfilingProvider registers a profiling.Provider with the injector.

Types

type Config

type Config struct {
	Pyroscope   *pyroscope.Config `env:"init"         envPrefix:"PYROSCOPE_"    json:"pyroscope,omitempty"`
	Pprof       *pprof.Config     `env:"init"         envPrefix:"PPROF_"        json:"pprof,omitempty"`
	ServiceName string            `env:"SERVICE_NAME" json:"serviceName"`
	Provider    string            `env:"PROVIDER"     json:"provider,omitempty"`
	// contains filtered or unexported fields
}

Config contains settings related to profiling.

func (*Config) ProvideProfilingProvider

func (c *Config) ProvideProfilingProvider(ctx context.Context, logger logging.Logger) (profiling.Provider, error)

ProvideProfilingProvider provides a profiling provider based on config.

func (*Config) ValidateWithContext

func (c *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates the config struct.

Jump to

Keyboard shortcuts

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