SHA256
1
0
forked from pool/telegraf
telegraf/feature_passive_amqp_exchange.patch
Jordi Massaguer cad2954985 Accepting request 590564 from home:mschnitzer
- Release 1.5.3
  * Bugfixes
    #3729: Set path to / if HOST_MOUNT_PREFIX matches full path.
    #3739: Remove userinfo from url tag in prometheus input.
    #3778: Fix ping plugin not reporting zero durations.
    #3807: Fix memory leak in postgresql_extensible.
    #3697: Disable keepalive in mqtt output to prevent deadlock.
    #3786: Fix collation difference in sqlserver input.
    #3871: Fix uptime metric in passenger input plugin.
    #3851: Add output of stderr in case of error to exec log message.

OBS-URL: https://build.opensuse.org/request/show/590564
OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/telegraf?expand=0&rev=3
2018-03-23 12:25:11 +00:00

70 lines
2.1 KiB
Diff

Index: telegraf-1.5.3/plugins/inputs/amqp_consumer/amqp_consumer.go
===================================================================
--- telegraf-1.5.3/plugins/inputs/amqp_consumer/amqp_consumer.go.original 2018-02-12 11:44:32.583888582 +0100
+++ telegraf-1.5.3/plugins/inputs/amqp_consumer/amqp_consumer.go 2018-02-12 11:53:42.111013874 +0100
@@ -20,6 +20,7 @@
URL string
// AMQP exchange
Exchange string
+ ExchangePassive bool
// Queue Name
Queue string
// Binding Key
@@ -65,6 +66,7 @@
url = "amqp://localhost:5672/influxdb"
## AMQP exchange
exchange = "telegraf"
+ exchange_passive = false
## AMQP queue name
queue = "telegraf"
## Binding Key
@@ -180,15 +182,27 @@
return nil, fmt.Errorf("Failed to open a channel: %s", err)
}
- err = ch.ExchangeDeclare(
- a.Exchange, // name
- "topic", // type
- true, // durable
- false, // auto-deleted
- false, // internal
- false, // no-wait
- nil, // arguments
- )
+ if a.ExchangePassive == true {
+ err = ch.ExchangeDeclarePassive(
+ a.Exchange, // name
+ "topic", // type
+ true, // durable
+ false, // auto-deleted
+ false, // internal
+ false, // no-wait
+ nil, // arguments
+ )
+ } else {
+ err = ch.ExchangeDeclare(
+ a.Exchange, // name
+ "topic", // type
+ true, // durable
+ false, // auto-deleted
+ false, // internal
+ false, // no-wait
+ nil, // arguments
+ )
+ }
if err != nil {
return nil, fmt.Errorf("Failed to declare an exchange: %s", err)
}
Index: telegraf-1.5.3/etc/telegraf.conf
===================================================================
--- telegraf-1.5.3/etc/telegraf.conf.original 2018-02-12 14:06:03.304072548 +0100
+++ telegraf-1.5.3/etc/telegraf.conf 2018-02-12 14:06:27.544041814 +0100
@@ -2747,6 +2747,7 @@
# url = "amqp://localhost:5672/influxdb"
# ## AMQP exchange
# exchange = "telegraf"
+# exchange_passive = false
# ## AMQP queue name
# queue = "telegraf"
# ## Binding Key