config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Config string `def:"<defaultAgentConfigPath>" desc:"location of config file" mapstructure:"config"`

	LogFilePath string `def:"<defaultAgentLogFilePath>" desc:"log file path" mapstructure:"log-file-path"`
	LogLevel    string `def:"info" desc:"log level: debug|info|warn|error" mapstructure:"log-level"`
	NoLogging   bool   `def:"false" desc:"disables logging from pyroscope" mapstructure:"no-logging"`

	ServerAddress          string        `def:"http://localhost:4040" desc:"address of the pyroscope server" mapstructure:"server-address"`
	AuthToken              string        `def:"" desc:"authorization token used to upload profiling data" mapstructure:"auth-token"`
	UpstreamThreads        int           `def:"4" desc:"number of upload threads" mapstructure:"upstream-threads"`
	UpstreamRequestTimeout time.Duration `def:"10s" desc:"profile upload timeout" mapstructure:"upstream-request-timeout"`

	Targets []Target `yaml:"targets" desc:"list of targets to be profiled" mapstructure:"-"`

	// Note that in YAML the key is 'tags' but the flag is 'tag'.
	Tags map[string]string `yaml:"tags" name:"tag" def:"" desc:"tag key value pairs" mapstructure:"-"`
}

func (Agent) Path added in v0.0.39

func (cfg Agent) Path() string

type Auth added in v0.0.38

type Auth struct {
	Google GoogleOauth `mapstructure:"google"`
	Gitlab GitlabOauth `mapstructure:"gitlab"`
	Github GithubOauth `mapstructure:"github"`

	// TODO: can we generate these automatically if it's empty?
	JWTSecret                string `json:"-" deprecated:"true" def:"" desc:"secret used to secure your JWT tokens" mapstructure:"jwt-secret"`
	LoginMaximumLifetimeDays int    `` /* 158-byte string literal not displayed */
}

type CombinedDbManager added in v0.0.38

type CombinedDbManager struct {
	*DbManager `mapstructure:",squash"`
	*Server    `mapstructure:",squash"`
}

func (CombinedDbManager) Path added in v0.0.39

func (cfg CombinedDbManager) Path() string

type Config

type Config struct {
	Version bool `mapstructure:"version"`

	Agent     Agent     `skip:"true" mapstructure:",squash"`
	Server    Server    `skip:"true" mapstructure:",squash"`
	Convert   Convert   `skip:"true" mapstructure:",squash"`
	Exec      Exec      `skip:"true" mapstructure:",squash"`
	DbManager DbManager `skip:"true" mapstructure:",squash"`
}

type Convert

type Convert struct {
	Format string `def:"tree" mapstructure:"format"`
}

type DbManager added in v0.0.17

type DbManager struct {
	LogLevel        string `def:"error" desc:"log level: debug|info|warn|error" mapstructure:"log-level"`
	StoragePath     string `def:"<installPrefix>/var/lib/pyroscope" desc:"directory where pyroscope stores profiling data" mapstructure:"storage-path"`
	DstStartTime    time.Time
	DstEndTime      time.Time
	SrcStartTime    time.Time
	ApplicationName string

	EnableProfiling bool `def:"false" desc:"enables profiling of dbmanager" mapstructure:"enable-profiling"`
}

type Exec

type Exec struct {
	SpyName                string        `def:"auto" desc:"name of the profiler you want to use. Supported ones are: <supportedProfilers>" mapstructure:"spy-name"`
	ApplicationName        string        `def:"" desc:"application name used when uploading profiling data" mapstructure:"application-name"`
	SampleRate             uint          `def:"100" desc:"sample rate for the profiler in Hz. 100 means reading 100 times per second" mapstructure:"sample-rate"`
	DetectSubprocesses     bool          `` /* 127-byte string literal not displayed */
	LogLevel               string        `def:"info" desc:"log level: debug|info|warn|error" mapstructure:"log-level"`
	ServerAddress          string        `def:"http://localhost:4040" desc:"address of the pyroscope server" mapstructure:"server-address"`
	AuthToken              string        `def:"" desc:"authorization token used to upload profiling data" mapstructure:"auth-token"`
	UpstreamThreads        int           `def:"4" desc:"number of upload threads" mapstructure:"upstream-threads"`
	UpstreamRequestTimeout time.Duration `def:"10s" desc:"profile upload timeout" mapstructure:"upstream-request-timeout"`
	NoLogging              bool          `def:"false" desc:"disables logging from pyroscope" mapstructure:"no-logging"`
	NoRootDrop             bool          `` /* 146-byte string literal not displayed */
	Pid                    int           `` /* 137-byte string literal not displayed */
	UserName               string        `def:"" desc:"starts process under specified user name" mapstructure:"user-name"`
	GroupName              string        `def:"" desc:"starts process under specified group name" mapstructure:"group-name"`
	PyspyBlocking          bool          `def:"false" desc:"enables blocking mode for pyspy" mapstructure:"pyspy-blocking"`
	RbspyBlocking          bool          `def:"false" desc:"enables blocking mode for rbspy" mapstructure:"rbspy-blocking"`

	Tags map[string]string `name:"tag" def:"" desc:"tag in key=value form. The flag may be specified multiple times" mapstructure:"tags"`
}

type File added in v0.0.39

type File interface{ Path() string }

File can be read from file system.

type GithubOauth added in v0.0.38

type GithubOauth struct {
	Enabled              bool     `json:"-" deprecated:"true" def:"false" desc:"enables Github Oauth" mapstructure:"enabled"`
	ClientID             string   `json:"-" deprecated:"true" def:"" desc:"client ID generated for Github API" mapstructure:"client-id"`
	ClientSecret         string   `json:"-" deprecated:"true" def:"" desc:"client secret generated for Github API" mapstructure:"client-secret"`
	RedirectURL          string   `` /* 182-byte string literal not displayed */
	AuthURL              string   `` /* 128-byte string literal not displayed */
	TokenURL             string   `` /* 133-byte string literal not displayed */
	AllowedOrganizations []string `` /* 140-byte string literal not displayed */
}

type GitlabOauth added in v0.0.38

type GitlabOauth struct {
	Enabled bool `json:"-" deprecated:"true" def:"false" desc:"enables Gitlab Oauth" mapstructure:"enabled"`
	// TODO: I changed this to ClientID to fit others, but in Gitlab docs it's Application ID so it might get someone confused?
	ClientID      string   `json:"-" deprecated:"true" def:"" desc:"client ID generated for GitLab API" mapstructure:"client-id"`
	ClientSecret  string   `json:"-" deprecated:"true" def:"" desc:"client secret generated for GitLab API" mapstructure:"client-secret"`
	RedirectURL   string   `` /* 182-byte string literal not displayed */
	AuthURL       string   `` /* 216-byte string literal not displayed */
	TokenURL      string   `` /* 210-byte string literal not displayed */
	APIURL        string   `` /* 196-byte string literal not displayed */
	AllowedGroups []string `` /* 171-byte string literal not displayed */
}

type GoogleOauth added in v0.0.38

type GoogleOauth struct {
	// TODO: remove deprecated: true when we enable these back
	Enabled        bool     `json:"-" deprecated:"true" def:"false" desc:"enables Google Oauth" mapstructure:"enabled"`
	ClientID       string   `json:"-" deprecated:"true" def:"" desc:"client ID generated for Google API" mapstructure:"client-id"`
	ClientSecret   string   `json:"-" deprecated:"true" def:"" desc:"client secret generated for Google API" mapstructure:"client-secret"`
	RedirectURL    string   `` /* 182-byte string literal not displayed */
	AuthURL        string   `` /* 172-byte string literal not displayed */
	TokenURL       string   `` /* 175-byte string literal not displayed */
	AllowedDomains []string `` /* 128-byte string literal not displayed */
}

TODO: Maybe merge Oauth structs into one (would have to move def and desc tags somewhere else in code)

type MetricsExportRule added in v0.2.1

type MetricsExportRule struct {
	Expr    string   `def:"" desc:"expression in FlameQL syntax to be evaluated against samples" mapstructure:"expr"`
	Node    string   `def:"total" desc:"tree node filter expression. Should be either 'total' or a valid regexp" mapstructure:"node"`
	GroupBy []string `def:"" desc:"list of tags to be used for aggregation. The tags are exported as prometheus labels" mapstructure:"group_by"`
}

type MetricsExportRules added in v0.2.1

type MetricsExportRules map[string]MetricsExportRule

type Server

type Server struct {
	AnalyticsOptOut bool `def:"false" desc:"disables analytics" mapstructure:"analytics-opt-out"`

	Config         string `def:"<installPrefix>/etc/pyroscope/server.yml" desc:"location of config file" mapstructure:"config"`
	LogLevel       string `def:"info" desc:"log level: debug|info|warn|error" mapstructure:"log-level"`
	BadgerLogLevel string `def:"error" desc:"log level: debug|info|warn|error" mapstructure:"badger-log-level"`

	StoragePath string `def:"<installPrefix>/var/lib/pyroscope" desc:"directory where pyroscope stores profiling data" mapstructure:"storage-path"`
	APIBindAddr string `def:":4040" desc:"port for the HTTP(S) server used for data ingestion and web UI" mapstructure:"api-bind-addr"`
	BaseURL     string `def:"" desc:"base URL for when the server is behind a reverse proxy with a different path" mapstructure:"base-url"`

	CacheEvictThreshold float64 `def:"0.25" desc:"percentage of memory at which cache evictions start" mapstructure:"cache-evict-threshold"`
	CacheEvictVolume    float64 `def:"0.33" desc:"percentage of cache that is evicted per eviction run" mapstructure:"cache-evict-volume"`

	// TODO: I don't think a lot of people will change these values.
	//   I think these should just be constants.
	BadgerNoTruncate     bool `` /* 137-byte string literal not displayed */
	DisablePprofEndpoint bool `def:"false" desc:"disables /debug/pprof route" mapstructure:"disable-pprof-endpoint"`

	MaxNodesSerialization int `def:"2048" desc:"max number of nodes used when saving profiles to disk" mapstructure:"max-nodes-serialization"`
	MaxNodesRender        int `def:"8192" desc:"max number of nodes used to display data on the frontend" mapstructure:"max-nodes-render"`

	// currently only used in our demo app
	HideApplications []string `def:"" desc:"please don't use, this will soon be deprecated" mapstructure:"hide-applications"`

	Retention time.Duration `` /* 163-byte string literal not displayed */

	// Deprecated fields. They can be set (for backwards compatibility) but have no effect
	// TODO: we should print some warning messages when people try to use these
	SampleRate          uint              `deprecated:"true" mapstructure:"sample-rate"`
	OutOfSpaceThreshold bytesize.ByteSize `deprecated:"true" mapstructure:"out-of-space-threshold"`
	CacheDimensionSize  int               `deprecated:"true" mapstructure:"cache-dimensions-size"`
	CacheDictionarySize int               `deprecated:"true" mapstructure:"cache-dictonary-size"`
	CacheSegmentSize    int               `deprecated:"true" mapstructure:"cache-segment-size"`
	CacheTreeSize       int               `deprecated:"true" mapstructure:"cache-tree-size"`

	Auth Auth `mapstructure:"auth"`

	MetricsExportRules MetricsExportRules `yaml:"metrics-export-rules" def:"" desc:"metrics export rules" mapstructure:"metrics-export-rules"`

	TLSCertificateFile string `def:"" desc:"location of TLS Certificate file (.crt)" mapstructure:"tls-certificate-file"`
	TLSKeyFile         string `def:"" desc:"location of TLS Private key file (.key)" mapstructure:"tls-key-file"`
}

func (Server) Path added in v0.0.39

func (cfg Server) Path() string

type Target added in v0.0.33

type Target struct {
	ServiceName string `yaml:"service-name" mapstructure:"service-name" desc:"name of the system service to be profiled"`

	SpyName            string `` /* 132-byte string literal not displayed */
	ApplicationName    string `yaml:"application-name" mapstructure:"application-name" def:"" desc:"application name used when uploading profiling data"`
	SampleRate         uint   `` /* 137-byte string literal not displayed */
	DetectSubprocesses bool   `` /* 154-byte string literal not displayed */

	// Spy-specific settings.
	PyspyBlocking bool `yaml:"pyspy-blocking" mapstructure:"pyspy-blocking" def:"false" desc:"enables blocking mode for pyspy"`
	RbspyBlocking bool `yaml:"rbspy-blocking" mapstructure:"rbspy-blocking" def:"false" desc:"enables blocking mode for rbspy"`

	// Tags are inherited from the agent level. At some point we may need
	// specifying tags at the target level (override).
	Tags map[string]string `yaml:"-"`
}

Jump to

Keyboard shortcuts

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