Closed dgnorton closed 2 years ago
I think that it is a good idea (and already good practice in other databases) to have a simple option to set application name. My preference would be to represent it as one string with documentation saying that it should distinguish applications that connect to the same InfluxDB. The same option should be better present in all InfluxDB clients (python, java, js ...).
It is already possible to customize anything in the request, including User-Agent, see #314.
I think that is fine. Also, maybe setting the application name should be required? That would break backwards compatibility but would be a simple update for clients and would encourage a best practice.
Ok. When an application name will be set, it will be added to the end of the current UA string. E.g.: influxdb-client-go/2.10.0 (linux; amd64) IoTHub/1.10
I don't love breaking a ton of users for this - maybe an annoying log message if the application name is unset would be enough?
Also an example of how to set custom headers with Doer
might be a good addition to the docs, if it's not there already.
I don't love breaking a ton of users for this - maybe an annoying log message if the application name is unset would be enough?
👍 That's exactly what I wanted to propose - a warning message to set application.
jfyi... the Mongo uses AppName
configuration options - https://pkg.go.dev/go.mongodb.org/mongo-driver@v1.10.3/mongo/options#ClientOptions.SetAppName
Proposal: Add a feature allowing users of this client library to override the default
influxdb-client-go
User-Agent HTTP header. This would make it easier to understand which apps are making which requests. E.g., currently, if App1 and App2 use this client, the UA coming from both will readinfluxdb-client-go
. Allowing the apps to override the UA would make it easier to distinguish between the two.Current behavior: User-Agent header is hard coded to
influxdb-client-go
Desired behavior: Add 2 options for users:
influxdb-client-go/2.3 AppName/Version
. Mark this in the docs as recommended.