Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimirtool: fix panic in loadgen command #7629

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Conversation

narqo
Copy link
Contributor

@narqo narqo commented Mar 14, 2024

What this PR does

This one fixes the panic in mimirtool loadgen

› go run ./cmd/mimirtool/ loadgen --write-url='http://127.0.0.1:9009/api/v1/push'
2024/03/14 20:23:59 setting up write load gen:
  url=http://127.0.0.1:9009/api/v1/push
  parallelism: 10
  active_series: 1000
 interval: 15s
2024/03/14 20:23:59 query load generation is disabled, -query-url flag has not been set
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100c3892c]

goroutine 95 [running]:
github.com/prometheus/client_golang/prometheus.(*HistogramVec).GetMetricWithLabelValues(0x140008ef080?, {0x1400127be30?, 0x103e3f900?, 0x140015a4000?})
	/Users/v/Documents/Code/grafana/mimir-main/vendor/github.com/prometheus/client_golang/prometheus/histogram.go:1165 +0x1c
github.com/prometheus/client_golang/prometheus.(*HistogramVec).WithLabelValues(...)
	/Users/v/Documents/Code/grafana/mimir-main/vendor/github.com/prometheus/client_golang/prometheus/histogram.go:1198
github.com/grafana/mimir/pkg/mimirtool/commands.(*LoadgenCommand).runBatch(0x14000c85110, 0x2bc, 0x320)
	/Users/v/Documents/Code/grafana/mimir-main/pkg/mimirtool/commands/loadgen.go:238 +0x4a0
github.com/grafana/mimir/pkg/mimirtool/commands.(*LoadgenCommand).runScrape(0x14000c85110, 0x2bc, 0x320)
	/Users/v/Documents/Code/grafana/mimir-main/pkg/mimirtool/commands/loadgen.go:194 +0x60
github.com/grafana/mimir/pkg/mimirtool/commands.(*LoadgenCommand).runWriteShard(0x14000c85110, 0x2bc, 0x320)
	/Users/v/Documents/Code/grafana/mimir-main/pkg/mimirtool/commands/loadgen.go:186 +0x78
created by github.com/grafana/mimir/pkg/mimirtool/commands.(*LoadgenCommand).run in goroutine 1
	/Users/v/Documents/Code/grafana/mimir-main/pkg/mimirtool/commands/loadgen.go:154 +0x698
exit status 2

The issues that command initializes local metrics in the different instance of LoadgenCommand variable, than what executes the command's action.

I guess, the part that no one's bumped into that for the past 4 years, speaks for how popular the command is 🤣

Which issue(s) this PR fixes or relates to

n/a

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@narqo narqo requested a review from a team as a code owner March 14, 2024 19:28
Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
@jhalterman jhalterman merged commit a1dab9e into main Mar 15, 2024
29 checks passed
@jhalterman jhalterman deleted the mimirtool-loadgen-panic branch March 15, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants