Writing a lot of data from CSV to InfluxDB using Telegraf

I have a C++ program that collects a lot of data from GPUs and other computers via DDS. I would like to write to influx as fast as possible. I have tried intervals 1s, 5s, 10s and metric buffer limits of 50000. I keep getting metric buffer overflows and collection took longer then expected. Is there any way to write faster without these errors?
The CSV has three columns: measurement, tag, float.

Skip telegraf, and write directly to the write endpoint or use the client libraries directly. What version and product of influxdb are you writing to?

How would I do that? Is there c++ libraries? I am using version 2.1.1. I am writing to Telegraf which writes to influxDB and then will be using Grafana to display the data.

I don’t we have a c++17 compiler. How would I go about writing directly to the database from a c++ program?

InfluxDB offers an API for users to send data directly to. Specifcally, you are looking for the /api/v2/write endpoint. I would look up how to write or for examples of writing an HTTP client to to hit an API.

Additionally, there is a C++ client library for InfluxDB 1.x, which you could look at for inspiration. The big difference being the API URL and the use of orgs, database, and tokens.

@jpowers I will look at both of the links provided. For the write endpoint, how would that be included in a C++ program?