是否可以动态发送 influx db 标签,以下配置似乎不起作用,因为当我尝试通过 influx db 客户端选择所有标签时,它返回 0 结果,请告知应该如何更改它。提前致谢。
(def send-influx
(influxdb/influxdb {
:host "localhost"
:db "riemann"
:username "riemann"
:password "riemann"}
))
(streams
(where (and (not (expired? event)) (service "service"))
#(info %)
(by [:host :service :id]
(changed :metric {:pairs? true}
(fn [[startEvent endEvent]]
(when-not (empty? startEvent)
(let [diff (- (:metric endEvent) (:metric startEvent))]
(send-influx [{
:host (:host startEvent),
:service (:service startEvent),
:id (:id startEvent),
:metric diff,
:time (:time startEvent) },
:tag-fields {:id (:id startEvent)} }]
)
)
)
)
)
)
))