github.com/grafana/pyroscope@v1.18.0/pkg/validation/symbolizer.go (about)

     1  package validation
     2  
     3  import (
     4  	"flag"
     5  )
     6  
     7  type Symbolizer struct {
     8  	// Enabled enables the symbolizer in the query frontend.
     9  	Enabled bool `yaml:"enabled" json:"enabled" category:"experimental" doc:"hidden"`
    10  
    11  	// Maximum symbol size is checked against both the payload size and the decompressed size
    12  	MaxSymbolSizeBytes int
    13  }
    14  
    15  func (s *Symbolizer) RegisterFlags(f *flag.FlagSet) {
    16  	f.BoolVar(&s.Enabled, "symbolizer.enabled", false, "Enable symbolization for tenants by default.")
    17  	f.IntVar(&s.MaxSymbolSizeBytes, "valdation.symbolizer.max-symbol-size-bytes", 512*1024*1024, "Maximum size of a symbol in bytes. This an upper limits to both the compressed and uncompressed size. 0 to disable.")
    18  }
    19  
    20  func (o *Overrides) SymbolizerEnabled(tenantID string) bool {
    21  	return o.getOverridesForTenant(tenantID).Symbolizer.Enabled
    22  }
    23  
    24  func (o *Overrides) SymbolizerMaxSymbolSizeBytes(tenantID string) int {
    25  	return o.getOverridesForTenant(tenantID).Symbolizer.MaxSymbolSizeBytes
    26  }