Skip to content

Commit 829f81e

Browse files
committed
Add symbolizer enabled tenant flag cli support and clean minor things
1 parent be7f2ef commit 829f81e

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

pkg/experiment/symbolizer/symbolizer.go

+2-10
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s *Symbolizer) SymbolizePprof(ctx context.Context, profile *googlev1.Profi
7676
if mapping.HasFunctions && mapping.HasFilenames && mapping.HasLineNumbers {
7777
continue
7878
}
79-
mappingsToSymbolize[uint64(i+1)] = true // MappingId is 1-indexed
79+
mappingsToSymbolize[uint64(i+1)] = true
8080
}
8181
if len(mappingsToSymbolize) == 0 {
8282
return nil
@@ -110,7 +110,7 @@ func (s *Symbolizer) groupLocationsByMapping(profile *googlev1.Profile, mappings
110110
return nil, fmt.Errorf("invalid profile: location at index %d references non-existent mapping %d", i, loc.MappingId)
111111
}
112112

113-
if !mappingsToSymbolize[loc.MappingId] || len(loc.Line) > 0 {
113+
if !mappingsToSymbolize[loc.MappingId] {
114114
continue
115115
}
116116

@@ -127,10 +127,6 @@ func (s *Symbolizer) groupLocationsByMapping(profile *googlev1.Profile, mappings
127127
func (s *Symbolizer) symbolizeLocationsForMapping(ctx context.Context, profile *googlev1.Profile, mappingID uint64, locs []locToSymbolize) error {
128128
mapping := profile.Mapping[mappingID-1]
129129

130-
if mapping.HasFunctions && mapping.HasFilenames && mapping.HasLineNumbers {
131-
return nil
132-
}
133-
134130
binaryName, err := s.extractBinaryName(profile, mapping)
135131
if err != nil {
136132
return err
@@ -219,10 +215,6 @@ func (s *Symbolizer) updateProfileWithSymbols(profile *googlev1.Profile, mapping
219215
}
220216

221217
for i, symLoc := range symLocs {
222-
if len(symLoc.Lines) == 0 {
223-
continue
224-
}
225-
226218
locIdx := locs[i].idx
227219
profile.Location[locIdx].Line = make([]*googlev1.Line, len(symLoc.Lines))
228220

pkg/test/integration/helper.go

+2
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ func (p *PyroscopeTest) Configure(t *testing.T, v2 bool) *PyroscopeTest {
180180
p.config.Metastore.Raft.Dir = t.TempDir()
181181
p.config.Metastore.Raft.SnapshotsDir = t.TempDir()
182182
p.config.Metastore.FSM.DataDir = t.TempDir()
183+
p.config.LimitsConfig.SymbolizerEnabled = false
184+
p.config.Symbolizer.Enabled = false
183185
}
184186
return p
185187
}

pkg/validation/limits.go

+2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) {
193193
f.Var(&l.IngestionRelabelingDefaultRulesPosition, "distributor.ingestion-relabeling-default-rules-position", "Position of the default ingestion relabeling rules in relation to relabel rules from overrides. Valid values are 'first', 'last' or 'disabled'.")
194194
_ = l.IngestionRelabelingRules.Set("[]")
195195
f.Var(&l.IngestionRelabelingRules, "distributor.ingestion-relabeling-rules", "List of ingestion relabel configurations. The relabeling rules work the same way, as those of [Prometheus](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config). All rules are applied in the order they are specified. Note: In most situations, it is more effective to use relabeling directly in Grafana Alloy.")
196+
197+
f.BoolVar(&l.SymbolizerEnabled, "symbolizer.tenant-enabled", true, "When symbolizer.enabled is true, this controls whether symbolization is enabled for tenants by default. Can be overridden per-tenant.")
196198
}
197199

198200
// UnmarshalYAML implements the yaml.Unmarshaler interface.

0 commit comments

Comments
 (0)