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

cmd/bosun/expr: fix crash on invalid graphite tags #1663

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

avereha
Copy link
Contributor

@avereha avereha commented Mar 11, 2016

Check that we are not generating invalid tags in parseGraphiteResponse
because that would result in a crash if we try to create an Incident
with these tags.

I was able to reproduce the crash using this alert:

alert example.graphite {
        template = generic
        $graphite = graphite("sumSeries(constantLine(1),constantLine(2))", "5m", "", "")
        warn = avg($graphite) > 1
}

panic: opentsdb: bad tag: constantLine(2))

goroutine 67 [running]:
panic(0xd70e60, 0xc8200e2610)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
bosun.org/models.AlertKey.Group(0xc820846700, 0x40, 0xc820846700)
    /Users/avereha/src/go/src/bosun.org/models/alertKey.go:46 +0x286
bosun.org/cmd/bosun/sched.NewIncident(0xc820846700, 0x40, 0xc82034dbc0)
    /Users/avereha/src/go/src/bosun.org/cmd/bosun/sched/check.go:46 +0x11d
bosun.org/cmd/bosun/sched.(*Schedule).runHistory(0x18fcf60, 0xc82021c2c0, 0xc820846700, 0x40, 0xc820846740, 0xc820846e80, 0x0, 0x0, 0x0)
    /Users/avereha/src/go/src/bosun.org/cmd/bosun/sched/check.go:151 +0x3f1
bosun.org/cmd/bosun/sched.(*Schedule).RunHistory(0x18fcf60, 0xc82021c2c0)
    /Users/avereha/src/go/src/bosun.org/cmd/bosun/sched/check.go:91 +0x118
bosun.org/cmd/bosun/sched.(*Schedule).checkAlert(0x18fcf60, 0xc8200c0300)
    /Users/avereha/src/go/src/bosun.org/cmd/bosun/sched/alertRunner.go:54 +0xec
bosun.org/cmd/bosun/sched.(*Schedule).RunAlert(0x18fcf60, 0xc8200c0300)
    /Users/avereha/src/go/src/bosun.org/cmd/bosun/sched/alertRunner.go:41 +0x5f
created by bosun.org/cmd/bosun/sched.(*Schedule).Run
    /Users/avereha/src/go/src/bosun.org/cmd/bosun/sched/alertRunner.go:24 +0x1d4

This change fixes #1608(I tested this) and probably #710(same backtrace).

Check that we are not generating invalid tags in parseGraphiteResponse
because that would result in a crash if we try to create an Incident
with these tags.
kylebrandt added a commit that referenced this pull request Mar 11, 2016
cmd/bosun/expr: fix crash on invalid graphite tags
@kylebrandt kylebrandt merged commit b602ab7 into bosun-monitor:master Mar 11, 2016
@avereha avereha deleted the graphite_tag_crash branch March 11, 2016 21:16
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.

graphite alert breaks when log() is used.
2 participants