influxdata / influxdb-client-java

InfluxDB 2 JVM Based Clients
https://influxdata.github.io/influxdb-client-java/
MIT License
431 stars 129 forks source link

can't write to telegraf (inputs.influxdb_v2_listener) instead of influx #631

Closed mehrdad2000 closed 11 months ago

mehrdad2000 commented 11 months ago

Hi currently send metric from my java app via "influx java client library" to influxdb. now need to send telegraf instead of influx , so add below parameter to telegraf.

[[inputs.influxdb_v2_listener]] service_address = ":8086"

after reset telegraf got this error on my java app: 2023-10-17 09:11:34,731 ERROR [ApiWriter] Can not write to influx, writeApi is null!

here is the code:

import com.influxdb.client.*; import com.influxdb.client.write.Point;

public void write(Point point) { if (writeApi == null) { LOGGER.error("Can not write to influx, writeApi is null!"); return;

Any idea? Thanks

powersj commented 11 months ago

Closing this as we have discussed that telegraf does not implement the health API.