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

duplicate metrics collector registration panic when using remotecfg #2801

Open
tpaschalis opened this issue Feb 21, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@tpaschalis
Copy link
Member

What's wrong?

I ran Alloy with the remotecfg block and got a panic: duplicate metrics collector registration attempted

Steps to reproduce

Not sure yet, will update the issue accordingly.

System information

macOS

Software version

Grafana Alloy v1.5.1

Configuration

remotecfg {
	url            = "URL"
	id             = sys.env("GCLOUD_FM_COLLECTOR_ID")
	poll_frequency = "60s"

	basic_auth {
		username = "USER"
		password = "PASS"
	}
}

Logs

ts=2025-02-21T10:29:28.28662Z level=info msg="finished complete graph evaluation" controller_path=/ controller_id=remotecfg trace_id=bc9d6fe592c45275f8fc59bf129fc7f6 duration=2.47425ms
panic: duplicate metrics collector registration attempted

goroutine 59 [running]:
github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0x11504e240, {0x14003cbddb0?, 0xa?, 0x14001ea156a?})
	github.com/prometheus/[email protected]/prometheus/registry.go:406 +0x78
github.com/grafana/alloy/internal/runtime/internal/controller.NewLoader({{0x1400046f810, {0x10fd81250, 0x14001e4ce80}, {0x10bf89fcd, 0xb}, 0x2, 0x14003cbdb60, 0x14003cbdb20, {0x10fde02d0, 0x11504e240}, ...}, ...})
	github.com/grafana/alloy/internal/runtime/internal/controller/loader.go:110 +0x5e8
github.com/grafana/alloy/internal/runtime.newController({{{0x14001ea1560, 0x2c}, 0x1400046f810, 0x14001e4ce80, {0x10bf89fcd, 0xb}, {0x10fde02d0, 0x11504e240}, 0x2, 0x14003cbdb20, ...}, ...})
	github.com/grafana/alloy/internal/runtime/alloy.go:196 +0x56c
github.com/grafana/alloy/internal/runtime.newModule(0x1400207a930)
	github.com/grafana/alloy/internal/runtime/module.go:133 +0x28c
github.com/grafana/alloy/internal/runtime.(*moduleController).NewCustomComponent(0x14002a28a80, {0x0, 0x0}, 0x14003cbdb10)
	github.com/grafana/alloy/internal/runtime/module.go:76 +0x164
github.com/grafana/alloy/internal/runtime/internal/controller.(*CustomComponentNode).evaluate(0x1400361c340, 0x14003cbdb00)
	github.com/grafana/alloy/internal/runtime/internal/controller/node_custom_component.go:192 +0x198
github.com/grafana/alloy/internal/runtime/internal/controller.(*CustomComponentNode).Evaluate(0x1400361c340, 0x107ef37c4?)
	github.com/grafana/alloy/internal/runtime/internal/controller/node_custom_component.go:167 +0x20
github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).evaluate(0x1400341e340, {0x10fd58fa0, 0x140042fbcc0}, {0x10fe097a0, 0x1400361c340})
	github.com/grafana/alloy/internal/runtime/internal/controller/loader.go:837 +0x50
github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply.func2({0x10fd5b480, 0x1400361c340})
	github.com/grafana/alloy/internal/runtime/internal/controller/loader.go:207 +0xd34
github.com/grafana/alloy/internal/runtime/internal/dag.WalkTopological(0x140034aa500, {0x140001c8680, 0x6, 0x114b16c30?}, 0x14006357980)
	github.com/grafana/alloy/internal/runtime/internal/dag/walk.go:83 +0x194
github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply(0x1400341e340, {0x0, {0x140034aa4e0, 0x3, 0x4}, {0x0, 0x0, 0x0}, {0x140034aa4c0, 0x3, ...}, ...})
	github.com/grafana/alloy/internal/runtime/internal/controller/loader.go:190 +0x894
github.com/grafana/alloy/internal/runtime.(*Runtime).applyLoaderConfig(0x1400345c000, {0x0, {0x140034aa4e0, 0x3, 0x4}, {0x0, 0x0, 0x0}, {0x140034aa4c0, 0x3, ...}, ...})
	github.com/grafana/alloy/internal/runtime/alloy.go:334 +0x108
github.com/grafana/alloy/internal/runtime.(*Runtime).LoadSource(0x1400345c000, 0x1400344ea10, 0x0, {0x16af134bc, 0x24})
	github.com/grafana/alloy/internal/runtime/alloy.go:307 +0x2b4
github.com/grafana/alloy/internal/runtime.ServiceController.LoadSource({0x14003755de8?}, {0x1400634e000?, 0x1?, 0x14010ea4ab0?}, 0x0, {0x16af134bc, 0x24})
	github.com/grafana/alloy/internal/runtime/alloy_services.go:101 +0x80
github.com/grafana/alloy/internal/service/remotecfg.(*Service).parseAndLoad(0x14002631680, {0x1400634e000, 0xfb5, 0x1000})
	github.com/grafana/alloy/internal/service/remotecfg/remotecfg.go:471 +0x11c
github.com/grafana/alloy/internal/service/remotecfg.(*Service).fetchRemote(0x14002631680)
	github.com/grafana/alloy/internal/service/remotecfg/remotecfg.go:392 +0x230
github.com/grafana/alloy/internal/service/remotecfg.(*Service).Run(0x14002631680, {0x10fe08728, 0x14003410370}, {0x10fe18b40?, 0x140027ddc00?})
	github.com/grafana/alloy/internal/service/remotecfg/remotecfg.go:270 +0x134
github.com/grafana/alloy/internal/runtime/internal/controller.(*ServiceNode).Run(0x0?, {0x10fe08728?, 0x14003410370?})
	github.com/grafana/alloy/internal/runtime/internal/controller/node_service.go:124 +0x3c
github.com/grafana/alloy/internal/runtime/internal/controller.newTask.func1()
	github.com/grafana/alloy/internal/runtime/internal/controller/scheduler.go:150 +0x3c
created by github.com/grafana/alloy/internal/runtime/internal/controller.newTask in goroutine 225
	github.com/grafana/alloy/internal/runtime/internal/controller/scheduler.go:149 +0x12c
@tpaschalis tpaschalis added the bug Something isn't working label Feb 21, 2025
@tpaschalis tpaschalis changed the title duplicate metrics collector panic when using remotecfg duplicate metrics registration panic when using remotecfg Feb 21, 2025
@tpaschalis tpaschalis changed the title duplicate metrics registration panic when using remotecfg duplicate metrics collector registration panic when using remotecfg Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant