Skip to content

Commit

Permalink
fix: null pointer panic in scraper handler (#2564)
Browse files Browse the repository at this point in the history
* fix: null pointer panic in scraper handler

* chore: update changelog
  • Loading branch information
docmerlin authored Jun 2, 2021
1 parent 5a1ba2c commit 22315fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- [#2559](https://github.com/influxdata/kapacitor/pull/2559): kapacitor cli supports flux tasks
- [#2560](https://github.com/influxdata/kapacitor/pull/2560): enable new-style slack apps

### Bugfixes
- [#2564](https://github.com/influxdata/kapacitor/pull/2564): Fix a panic in the scraper handler when debug mode is enabled

## v1.5.9 [2021-04-01]

### Bugfixes
Expand Down
6 changes: 4 additions & 2 deletions services/diagnostic/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,8 @@ type EC2Handler struct {
func (h *EC2Handler) WithClusterContext(cluster string) ec2.Diagnostic {
return &EC2Handler{
ScraperHandler: &ScraperHandler{
l: h.ScraperHandler.l.With(String("cluster_id", cluster)),
l: h.ScraperHandler.l.With(String("cluster_id", cluster)),
buf: &bytes.Buffer{},
},
}
}
Expand Down Expand Up @@ -1266,7 +1267,8 @@ func (h *ScraperHandler) With(key string, value interface{}) plog.Logger {
}

return &ScraperHandler{
l: h.l.With(field),
l: h.l.With(field),
buf: &bytes.Buffer{},
}
}

Expand Down

0 comments on commit 22315fb

Please sign in to comment.