private void BeforeExecuteCommand(MySqlDataTraceCommand command)
        {
            var activity = MySqlActivitySourceHelper.ActivitySource.StartActivity(
                MySqlActivitySourceHelper.ActivityName,
                ActivityKind.Client,
                Activity.Current?.Context ?? default(ActivityContext),
                MySqlActivitySourceHelper.CreationTags);

            if (activity == null)
            {
                return;
            }

            if (activity.IsAllDataRequested)
            {
                if (this.options.SetDbStatement)
                {
                    activity.SetTag(SemanticConventions.AttributeDbStatement, command.SqlText);
                }

                if (command.ConnectionStringBuilder != null)
                {
                    activity.DisplayName = command.ConnectionStringBuilder.Database;
                    activity.SetTag(SemanticConventions.AttributeDbName, command.ConnectionStringBuilder.Database);

                    this.AddConnectionLevelDetailsToActivity(command.ConnectionStringBuilder, activity);
                }
            }
        }
        private MySqlDataTraceCommand GetCommand(object driverIdObj, object cmd)
        {
            var command = new MySqlDataTraceCommand();

            if (this.dbConn.TryGetValue((long)driverIdObj, out var database))
            {
                command.ConnectionStringBuilder = database;
            }

            command.SqlText = cmd == null ? string.Empty : cmd.ToString();
            return(command);
        }