Versions in this module Expand all Collapse all v2 v2.0.1 Apr 20, 2026 v2.0.0 Apr 20, 2026 Changes in this version + const BodySizeLimit + const DroppedByRelabelRules + const DuplicateLabelNames + const DuplicateLabelNamesAfterSanitizationErrorMsg + const DuplicateLabelNamesErrorMsg + const FlameGraphLimit + const IngestLimitReached + const InvalidLabels + const InvalidLabelsErrorMsg + const LabelNameTooLong + const LabelNameTooLongErrorMsg + const LabelValueTooLong + const LabelValueTooLongErrorMsg + const MalformedProfile + const MaxFlameGraphNodesErrorMsg + const MaxFlameGraphNodesUnlimitedErrorMsg + const MaxLabelNamesPerSeries + const MaxLabelNamesPerSeriesErrorMsg + const MinCompactorPartialBlockDeletionDelay + const MissingLabels + const MissingLabelsErrorMsg + const NotInIngestionWindow + const NotInIngestionWindowErrorMsg + const ProfileSizeLimit + const ProfileTooBigErrorMsg + const ProfileTooManySampleLabelsErrorMsg + const ProfileTooManySamplesErrorMsg + const QueryInvalidTimeRange + const QueryLimit + const QueryMissingTimeRange + const QueryMissingTimeRangeErrorMsg + const QueryStartAfterEndErrorMsg + const QueryTooLongErrorMsg + const RateLimited + const ReasonLabel + const SampleLabelsLimit + const SamplesLimit + const SeriesLimit + const SeriesLimitErrorMsg + const SkippedBySamplingRules + const Unknown + var DiscardedBytes = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var DiscardedProfiles = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + func GetOverride[T any](o *Overrides, fn func(string, *Limits) T) (defaults T, overrides iter.Seq2[string, T]) + func SanitizeLegacyLabelName(ln string) (old, sanitized string, ok bool) + func SanitizeTimeRange(limits RangeRequestLimits, tenant []string, start, end *int64) (empty bool, err error) + func SetDefaultLimitsForYAMLUnmarshalling(defaults Limits) + func TenantLimitsHandler(defaultLimits Limits, tenantLimits TenantLimits) http.HandlerFunc + func ValidateLabels(limits LabelValidationLimits, tenantID string, ls []*typesv1.LabelPair, ...) ([]*typesv1.LabelPair, error) + func ValidateMaxNodes(l FlameGraphLimits, tenantIDs []string, n int64) (int64, error) + type Error struct + Reason Reason + func NewErrorf(reason Reason, msg string, args ...interface{}) *Error + func (e *Error) Error() string + type FlameGraphLimits interface + MaxFlameGraphNodesDefault func(string) int + MaxFlameGraphNodesMax func(string) int + MaxFlameGraphNodesOnSelectMergeProfile func(string) bool + type IngestionRelabelRules []*relabel.Config + func (r *IngestionRelabelRules) ExampleDoc() (comment string, yaml interface{}) + func (r *IngestionRelabelRules) Set(s string) error + func (r *IngestionRelabelRules) String() string + type LabelValidationLimits interface + DisableLabelSanitization func(tenantID string) bool + MaxLabelNameLength func(tenantID string) int + MaxLabelNamesPerSeries func(tenantID string) int + MaxLabelValueLength func(tenantID string) int + type LimitError string + func (e LimitError) Error() string + type Limits struct + AdaptivePlacementLimits placement.PlacementLimits + CompactorBlocksRetentionPeriod model.Duration + CompactorDownsamplerEnabled bool + CompactorPartialBlockDeletionDelay model.Duration + CompactorSplitAndMergeShards int + CompactorSplitAndMergeStageSize int + CompactorSplitGroups int + CompactorTenantShardSize int + DisableLabelSanitization bool + DistributorAggregationPeriod model.Duration + DistributorAggregationWindow model.Duration + DistributorSampling *sampling.Config + DistributorUsageGroups *UsageGroupConfig + EnforceLabelsOrder bool + IngestionArtificialDelay model.Duration + IngestionBodyLimitMB float64 + IngestionBurstSizeMB float64 + IngestionLimit *ingestlimits.Config + IngestionRateMB float64 + IngestionRelabelingDefaultRulesPosition RelabelRulesPosition + IngestionRelabelingRules IngestionRelabelRules + IngestionTenantShardSize int + MaxFlameGraphNodesDefault int + MaxFlameGraphNodesMax int + MaxFlameGraphNodesOnSelectMergeProfile bool + MaxGlobalSeriesPerTenant int + MaxLabelNameLength int + MaxLabelNamesPerSeries int + MaxLabelValueLength int + MaxLocalSeriesPerTenant int + MaxProfileSizeBytes int + MaxProfileStacktraceDepth int + MaxProfileStacktraceSampleLabels int + MaxProfileStacktraceSamples int + MaxProfileSymbolValueLength int + MaxQueryLength model.Duration + MaxQueryLookback model.Duration + MaxQueryParallelism int + MaxSessionsPerSeries int + QueryAnalysisEnabled bool + QueryAnalysisSeriesEnabled bool + QuerySanitizeOnMerge bool + QuerySplitDuration model.Duration + ReadPathOverrides readpath.Config + RecordingRules RecordingRules + RejectNewerThan model.Duration + RejectOlderThan model.Duration + Retention retention.Config + S3SSEKMSEncryptionContext string + S3SSEKMSKeyID string + S3SSEType string + SampleTypeRelabelingRules SampleTypeRelabelRules + StoreGatewayTenantShardSize int + Symbolizer Symbolizer + WritePathOverrides writepath.Config + func MockDefaultLimits() *Limits + func (l *Limits) RegisterFlags(f *flag.FlagSet) + func (l *Limits) UnmarshalYAML(unmarshal func(interface{}) error) error + func (l *Limits) Validate() error + type MockLimits struct + DisableLabelSanitizationValue bool + DistributorAggregationPeriodValue time.Duration + DistributorAggregationWindowValue time.Duration + IngestionBodyLimitBytesValue int64 + MaxFlameGraphNodesDefaultValue int + MaxFlameGraphNodesMaxValue int + MaxFlameGraphNodesOnSelectMergeProfileValue bool + MaxLabelNameLengthValue int + MaxLabelNamesPerSeriesValue int + MaxLabelValueLengthValue int + MaxProfileSizeBytesValue int + MaxProfileStacktraceDepthValue int + MaxProfileStacktraceSampleLabelsValue int + MaxProfileStacktraceSamplesValue int + MaxProfileSymbolValueLengthValue int + MaxQueriersPerTenantValue int + MaxQueryLengthValue time.Duration + MaxQueryLookbackValue time.Duration + MaxQueryParallelismValue int + QueryAnalysisEnabledValue bool + QueryAnalysisSeriesEnabledValue bool + QuerySanitizeOnMergeValue bool + QuerySplitDurationValue time.Duration + QueryTreeEnabledValue bool + RejectNewerThanValue time.Duration + RejectOlderThanValue time.Duration + SymbolizerEnabledValue bool + func (m MockLimits) DisableLabelSanitization(userID string) bool + func (m MockLimits) DistributorAggregationPeriod(userID string) time.Duration + func (m MockLimits) DistributorAggregationWindow(userID string) time.Duration + func (m MockLimits) IngestionBodyLimitBytes(tenantID string) int64 + func (m MockLimits) MaxFlameGraphNodesDefault(string) int + func (m MockLimits) MaxFlameGraphNodesMax(string) int + func (m MockLimits) MaxFlameGraphNodesOnSelectMergeProfile(string) bool + func (m MockLimits) MaxLabelNameLength(userID string) int + func (m MockLimits) MaxLabelNamesPerSeries(userID string) int + func (m MockLimits) MaxLabelValueLength(userID string) int + func (m MockLimits) MaxProfileSizeBytes(userID string) int + func (m MockLimits) MaxProfileStacktraceDepth(userID string) int + func (m MockLimits) MaxProfileStacktraceSampleLabels(userID string) int + func (m MockLimits) MaxProfileStacktraceSamples(userID string) int + func (m MockLimits) MaxProfileSymbolValueLength(userID string) int + func (m MockLimits) MaxQueriersPerTenant(_ string) int + func (m MockLimits) MaxQueryLength(tenantID string) time.Duration + func (m MockLimits) MaxQueryLookback(tenantID string) time.Duration + func (m MockLimits) MaxQueryParallelism(string) int + func (m MockLimits) QueryAnalysisEnabled(tenantID string) bool + func (m MockLimits) QueryAnalysisSeriesEnabled(tenantID string) bool + func (m MockLimits) QuerySanitizeOnMerge(tenantID string) bool + func (m MockLimits) QuerySplitDuration(string) time.Duration + func (m MockLimits) QueryTreeEnabled(s string) bool + func (m MockLimits) RejectNewerThan(userID string) time.Duration + func (m MockLimits) RejectOlderThan(userID string) time.Duration + func (m MockLimits) SymbolizerEnabled(s string) bool + type Overrides struct + func MockDefaultOverrides() *Overrides + func MockOverrides(customize func(defaults *Limits, tenantLimits map[string]*Limits)) *Overrides + func NewOverrides(defaults Limits, tenantLimits TenantLimits) (*Overrides, error) + func (o *Overrides) AllByTenantID() map[string]*Limits + func (o *Overrides) CompactorBlocksRetentionPeriod(userID string) time.Duration + func (o *Overrides) CompactorDownsamplerEnabled(userId string) bool + func (o *Overrides) CompactorPartialBlockDeletionDelay(userID string) (delay time.Duration, valid bool) + func (o *Overrides) CompactorSplitAndMergeShards(userID string) int + func (o *Overrides) CompactorSplitAndMergeStageSize(userID string) int + func (o *Overrides) CompactorSplitGroups(userID string) int + func (o *Overrides) CompactorTenantShardSize(userID string) int + func (o *Overrides) DefaultLimits() *Limits + func (o *Overrides) DisableLabelSanitization(tenantID string) bool + func (o *Overrides) DistributorAggregationPeriod(tenantID string) model.Duration + func (o *Overrides) DistributorAggregationWindow(tenantID string) model.Duration + func (o *Overrides) DistributorSampling(tenantID string) *sampling.Config + func (o *Overrides) DistributorUsageGroups(tenantID string) *UsageGroupConfig + func (o *Overrides) EnforceLabelsOrder(tenantID string) bool + func (o *Overrides) IngestionArtificialDelay(tenantID string) time.Duration + func (o *Overrides) IngestionBodyLimitBytes(tenantID string) int64 + func (o *Overrides) IngestionBurstSizeBytes(tenantID string) int + func (o *Overrides) IngestionLimit(tenantID string) *ingestlimits.Config + func (o *Overrides) IngestionRateBytes(tenantID string) float64 + func (o *Overrides) IngestionRelabelingRules(tenantID string) []*relabel.Config + func (o *Overrides) IngestionTenantShardSize(tenantID string) int + func (o *Overrides) MaxFlameGraphNodesDefault(tenantID string) int + func (o *Overrides) MaxFlameGraphNodesMax(tenantID string) int + func (o *Overrides) MaxFlameGraphNodesOnSelectMergeProfile(tenantID string) bool + func (o *Overrides) MaxGlobalSeriesPerTenant(tenantID string) int + func (o *Overrides) MaxLabelNameLength(tenantID string) int + func (o *Overrides) MaxLabelNamesPerSeries(tenantID string) int + func (o *Overrides) MaxLabelValueLength(tenantID string) int + func (o *Overrides) MaxLocalSeriesPerTenant(tenantID string) int + func (o *Overrides) MaxProfileSizeBytes(tenantID string) int + func (o *Overrides) MaxProfileStacktraceDepth(tenantID string) int + func (o *Overrides) MaxProfileStacktraceSampleLabels(tenantID string) int + func (o *Overrides) MaxProfileStacktraceSamples(tenantID string) int + func (o *Overrides) MaxProfileSymbolValueLength(tenantID string) int + func (o *Overrides) MaxQueriersPerTenant(tenant string) int + func (o *Overrides) MaxQueryLength(tenantID string) time.Duration + func (o *Overrides) MaxQueryLookback(tenantID string) time.Duration + func (o *Overrides) MaxQueryParallelism(tenantID string) int + func (o *Overrides) MaxSessionsPerSeries(tenantID string) int + func (o *Overrides) PlacementLimits(tenantID string) placement.PlacementLimits + func (o *Overrides) QueryAnalysisEnabled(tenantID string) bool + func (o *Overrides) QueryAnalysisSeriesEnabled(tenantID string) bool + func (o *Overrides) QuerySanitizeOnMerge(tenantID string) bool + func (o *Overrides) QuerySplitDuration(tenantID string) time.Duration + func (o *Overrides) QueryTreeEnabled(tenantID string) bool + func (o *Overrides) ReadPathOverrides(tenantID string) readpath.Config + func (o *Overrides) RecordingRules(tenantId string) []*settingsv1.RecordingRule + func (o *Overrides) RejectNewerThan(tenantID string) time.Duration + func (o *Overrides) RejectOlderThan(tenantID string) time.Duration + func (o *Overrides) Retention() (defaults retention.Config, overrides iter.Seq2[string, retention.Config]) + func (o *Overrides) S3SSEKMSEncryptionContext(user string) string + func (o *Overrides) S3SSEKMSKeyID(user string) string + func (o *Overrides) S3SSEType(user string) string + func (o *Overrides) SampleTypeRelabelingRules(tenantID string) []*relabel.Config + func (o *Overrides) StoreGatewayTenantShardSize(userID string) int + func (o *Overrides) SymbolizerEnabled(tenantID string) bool + func (o *Overrides) SymbolizerMaxSymbolSizeBytes(tenantID string) int + func (o *Overrides) WritePathOverrides(tenantID string) writepath.Config + type OverwriteMarshalingStringMap struct + func NewOverwriteMarshalingStringMap(m map[string]string) OverwriteMarshalingStringMap + func (sm *OverwriteMarshalingStringMap) Map() map[string]string + func (sm *OverwriteMarshalingStringMap) UnmarshalJSON(val []byte) error + func (sm *OverwriteMarshalingStringMap) UnmarshalYAML(unmarshal func(interface{}) error) error + func (sm OverwriteMarshalingStringMap) MarshalJSON() ([]byte, error) + func (sm OverwriteMarshalingStringMap) MarshalYAML() (interface{}, error) + type ProfileValidationLimits interface + MaxProfileSizeBytes func(tenantID string) int + MaxProfileStacktraceDepth func(tenantID string) int + MaxProfileStacktraceSampleLabels func(tenantID string) int + MaxProfileStacktraceSamples func(tenantID string) int + MaxProfileSymbolValueLength func(tenantID string) int + RejectNewerThan func(tenantID string) time.Duration + RejectOlderThan func(tenantID string) time.Duration + type RangeRequestLimits interface + MaxQueryLength func(tenantID string) time.Duration + MaxQueryLookback func(tenantID string) time.Duration + type Reason string + func ReasonOf(err error) Reason + type RecordingRules []*settingsv1.RecordingRule + func (r *RecordingRules) RegisterFlags(f *flag.FlagSet) + func (r *RecordingRules) Set(s string) error + func (r *RecordingRules) String() string + func (r *RecordingRules) UnmarshalYAML(value *yaml.Node) error + type RelabelRules []*relabel.Config + func (p *RelabelRules) Set(s string) error + func (p *RelabelRules) String() string + type RelabelRulesPosition string + const RelabelRulePositionDisabled + const RelabelRulePositionFirst + const RelabelRulePositionLast + func (p *RelabelRulesPosition) Set(s string) error + func (p *RelabelRulesPosition) String() string + type RuntimeConfigValues struct + TenantLimits map[string]*Limits + func LoadRuntimeConfig(r io.Reader) (*RuntimeConfigValues, error) + type SampleTypeRelabelRules []*relabel.Config + func (r *SampleTypeRelabelRules) ExampleDoc() (comment string, yaml interface{}) + func (r *SampleTypeRelabelRules) Set(s string) error + func (r *SampleTypeRelabelRules) String() string + type Symbolizer struct + Enabled bool + MaxSymbolSizeBytes int + func (s *Symbolizer) RegisterFlags(f *flag.FlagSet) + type TenantLimits interface + AllByTenantID func() map[string]*Limits + RuntimeConfig func() *RuntimeConfigValues + TenantLimits func(tenantID string) *Limits + func NewMockTenantLimits(limits map[string]*Limits) TenantLimits + type TenantLimitsResponse struct + IngestionBurstSize int + IngestionRate float64 + MaxGlobalSeriesPerTenant int + type UsageGroupConfig struct + func NewUsageGroupConfig(m map[string]string) (*UsageGroupConfig, error) + func (c *UsageGroupConfig) UnmarshalJSON(bytes []byte) error + func (c *UsageGroupConfig) UnmarshalYAML(value *yaml.Node) error + type UsageGroupEvaluator struct + func NewUsageGroupEvaluator(logger log.Logger) *UsageGroupEvaluator + func (e *UsageGroupEvaluator) GetMatch(tenantID string, c *UsageGroupConfig, lbls phlaremodel.Labels) UsageGroupMatch + type UsageGroupMatch struct + func (m UsageGroupMatch) CountDiscardedBytes(reason string, n int64) + func (m UsageGroupMatch) CountReceivedBytes(profileType string, n int64) + func (m UsageGroupMatch) Names() []UsageGroupMatchName + type UsageGroupMatchName struct + ConfiguredName string + ResolvedName string + func (m *UsageGroupMatchName) IsMoreSpecificThan(other *UsageGroupMatchName) bool + func (m *UsageGroupMatchName) String() string + type ValidatedProfile struct + func ValidateProfile(limits ProfileValidationLimits, tenantID string, prof *pprof.Profile, ...) (ValidatedProfile, error) + type ValidatedRangeRequest struct + IsEmpty bool + func ValidateRangeRequest(limits RangeRequestLimits, tenantIDs []string, req model.Interval, ...) (ValidatedRangeRequest, error) Other modules containing this package github.com/grafana/pyroscope