Fix publishing of direct exchange routing key (#5868)
This commit is contained in:
parent
d25fa3ced3
commit
5bb6e4603d
|
@ -12,7 +12,6 @@ import (
|
||||||
"github.com/influxdata/telegraf/internal/tls"
|
"github.com/influxdata/telegraf/internal/tls"
|
||||||
"github.com/influxdata/telegraf/plugins/outputs"
|
"github.com/influxdata/telegraf/plugins/outputs"
|
||||||
"github.com/influxdata/telegraf/plugins/serializers"
|
"github.com/influxdata/telegraf/plugins/serializers"
|
||||||
|
|
||||||
"github.com/streadway/amqp"
|
"github.com/streadway/amqp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -206,8 +205,8 @@ func (q *AMQP) routingKey(metric telegraf.Metric) string {
|
||||||
|
|
||||||
func (q *AMQP) Write(metrics []telegraf.Metric) error {
|
func (q *AMQP) Write(metrics []telegraf.Metric) error {
|
||||||
batches := make(map[string][]telegraf.Metric)
|
batches := make(map[string][]telegraf.Metric)
|
||||||
if q.ExchangeType == "direct" || q.ExchangeType == "header" {
|
if q.ExchangeType == "header" {
|
||||||
// Since the routing_key is ignored for these exchange types send as a
|
// Since the routing_key is ignored for this exchange type send as a
|
||||||
// single batch.
|
// single batch.
|
||||||
batches[""] = metrics
|
batches[""] = metrics
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue