influxdb-client-go icon indicating copy to clipboard operation
influxdb-client-go copied to clipboard

line protocol String() method for data points

Open aep-sunlife opened this issue 6 months ago • 0 comments

Proposal:

Integrate the standard line protocol format into the String() method for Point, in order to facilitate debugging.

Current behavior:

The stock Go struct format is used.

Desired behavior:

The InfluxDB line protocol should be used.

In fact, InfluxDB publishes two separate Go modules, one for line protocol manipulation and another for HTTP request manipulation. The former uses encoder objects while the latter uses point objects. The latter provides internal functions to convert points to line protocol, though this is inaccessible via normal Go means, as the service handle underneath the WriteApi[Blocking] handles uses lowercase notation.

Alternatives considered:

At least promote the service field of the WriteApi[Blocking] handlers to a public API member.

Use case:

When troubleshooting metrics, it is more practical to see a human readable format such as the line protocol, rather than raw Go values.

aep-sunlife avatar Apr 07 '25 17:04 aep-sunlife