Skip to content

Memory leak in unused metric label feature #3040

@winder

Description

@winder

Subject of the issue

There is a dynamic "label" feature in Gauge and StringGauge. The label is a string argument when collecting metrics used as a key into the gauge dataset. If we ever use the feature for something unbound like round, address or session ID. At that point memory would grow unbounded until a crash.

A couple of possible solutions (we would need to do this for both gauges):

  1. Remove the labels feature (it seems to only be used by segment.go:EnterSegment and that function is not called anywhere).
  2. Return from this function immediately when len(valueIndices) <= 1
  3. Set maxMetricRetensionDuration to something very large in config.json

Earlier discussion here: #2508 (comment)

Acceptance criteria

Remove labels that can be associated with metrics.
Why: using the labels may lead to memory issues that lead to the node crashing.

Priority

Low / Tech debt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions