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

promhttp instrumented handler hangs with the invalid metric name #822

Closed
AlekSi opened this issue Dec 4, 2020 · 0 comments
Closed

promhttp instrumented handler hangs with the invalid metric name #822

AlekSi opened this issue Dec 4, 2020 · 0 comments
Labels

Comments

@AlekSi
Copy link
Contributor

AlekSi commented Dec 4, 2020

// Create a ConstMetric with the Desc. Since we don't know how many
// variable labels there are, try for as long as it needs.
for err := errors.New("dummy"); err != nil; lvs = append(lvs, magicString) {
m, err = prometheus.NewConstMetric(desc, prometheus.UntypedValue, 0, lvs...)
}

This code does not check what error is returned. If an invalid metric name is passed, the process consumes all memory and is killed by the OOM killer.

I found it when I passed sub-test's t.Name() as a part of the metric name: / can't a part of the metric name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants