You are connecting to a v3 instance, that is correct.
v2 SDK writes are supported via compatibility endpoints, but Flux queries are not officially supported and may break.
For long-term stability and performance, suggest migrating to the v3 SDK and native APIs for both writing and querying data.
For more guidance, see the table in this blog: https://www.influxdata.com/blog/choosing-client-library-when-developing-with-influxdb-3-0/