add Trino Python Client version to user agent #411
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Trino introduces some breaking changes for old client versions but there is no way to find out the client version of our users to warn them before upgrading to a newer version since the python client is using the default user agent from
requests
that resultspython-requests/2.31.0
. However, the JDBC driver sets a more descriptive user agent header value such asTrino JDBC Driver/371
that helps us to identify users with outdated client versions.This PR aims to specify the user agent to pass the current driver version to the coordinator to be logged later in query created and completed events as
io.trino.spi.eventlistener.QueryContext.userAgent
.Non-technical explanation
This change will allow us to spot outdated clients accessing our Trino cluster.
Release notes
( ) This is not user-visible or docs only and no release notes are required.
(x) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text: