diff --git a/plugins/inputs/rabbitmq/rabbitmq.go b/plugins/inputs/rabbitmq/rabbitmq.go index 4d119282d..6d5379438 100644 --- a/plugins/inputs/rabbitmq/rabbitmq.go +++ b/plugins/inputs/rabbitmq/rabbitmq.go @@ -146,7 +146,11 @@ func (r *RabbitMQ) Gather(acc telegraf.Accumulator) error { } func (r *RabbitMQ) requestJSON(u string, target interface{}) error { - u = fmt.Sprintf("%s%s", r.URL, u) + url := r.URL + if url == "" { + url = DefaultURL + } + u = fmt.Sprintf("%s%s", url, u) req, err := http.NewRequest("GET", u, nil) if err != nil {