influxdata / influxdata/influxdb

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

Open
#24,419 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Java entry point write(Point point) and the shown inputs.influxdb_v2_listener configuration. Check how the client creates writeApi and whether this listener accepts the client’s requests; done means a reproducible configuration and a confirmed write path or a documented incompatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.