-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify Application Name
and UseName
#1434
Labels
Comments
In the documentation, also mention that the "key" for a "keyed service" will be used as the name by default (but can be overridden): MySqlConnector/src/MySqlConnector.DependencyInjection/MySqlConnectorServiceCollectionExtensions.cs Line 130 in 8fffc06
|
bgrainger
added a commit
that referenced
this issue
Jan 14, 2024
Fixed in 2.3.4. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are two ways to specify a connection pool "name":
Application Name
in the connection string. This was added for Add "Application Name" connection string setting #547 to set theprogram_name
that is displayed in some diagnostic tools.MySqlDataSourceBuilder.UseName
. This was added in f53882e to disambiguate multiple data sources that have the same connection string. It's used to set the connection pool name, which is reported in metrics, logging, and activity tags.(A third way is to use a "keyed service" in DI with a string key; this will have the side effect of calling
.UseName
.)There's no good reason for these to be separate.
Application Name
should be deprecated, and.UseName
should be recommended as the preferred approach. If both are specified,UseName
will take precedence, otherwise the one that is set will be used. If none are set, the current behavior (forpool.name
andprogram_name
) will remain unchanged.The primary change is that specifying
Application Name
in the connection string will have the side-effect of settingpool.name
(in metrics) to that value for existing clients who are usingApplication Name
but haven't upgraded toMySqlDataSource
yet.The text was updated successfully, but these errors were encountered: