im trying to work this scenario
telegraf(nats) in → kapacitor task to measurement → telegraf(nats) out to clients
Everything is working fine expect the telegraf(nats) output
when i set the subject to subject = “natsout”
im receiving all the telegraf stream like diskio kapacitor and other measurement…
if im setting the subject name to subject = “telegraf.natsout” im geting nothing.
UPDATE
i review the telegraf code and its look like its sent all the metrics from telegref and not from the measurement only.
the only thing i can think about it without breaking the interface is to filter by name
func (n *NATS) Write(metrics telegraf.Metric) error {
if len(metrics) == 0 {
return nil
}
for _, metric := range metrics {
//if metric.Name = n.measurement send it…
buf, err := n.serializer.Serialize(metric)
if err != nil {
return err
}
err = n.conn.Publish(n.Subject, buf) if err != nil { return fmt.Errorf("FAILED to send NATS message: %s", err) }
}
return nil
}
Any suggestions ?